From 974b0e57f1c1d8fc34e64db3237a92749e91d7e4 Mon Sep 17 00:00:00 2001 From: alydev Date: Thu, 25 Sep 2025 04:22:53 +0000 Subject: [PATCH] update --- flake.nix | 9 ++------- hw/aly-server.nix | 36 ++++++++++++++++++++++++++++++++++++ system/aly-server.nix | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 hw/aly-server.nix create mode 100644 system/aly-server.nix diff --git a/flake.nix b/flake.nix index c562f22..f03168f 100644 --- a/flake.nix +++ b/flake.nix @@ -45,14 +45,9 @@ nur.modules.nixos.default nix-flatpak.nixosModules.nix-flatpak nixvim.nixosModules.nixvim + ./hw/aly-server.nix + ./system/aly-server.nix # TODO - ./system/global.nix - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.aly = import ./home/aly.nix; - } ]; }; }; diff --git a/hw/aly-server.nix b/hw/aly-server.nix new file mode 100644 index 0000000..1e3330d --- /dev/null +++ b/hw/aly-server.nix @@ -0,0 +1,36 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = [ ]; + + boot.initrd.availableKernelModules = [ "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/1ede5a16-78e9-4874-b39f-b1d31a021774"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/EF0E-1E4B"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eth0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + virtualisation.hypervGuest.enable = true; +} diff --git a/system/aly-server.nix b/system/aly-server.nix new file mode 100644 index 0000000..d948416 --- /dev/null +++ b/system/aly-server.nix @@ -0,0 +1,35 @@ +({ config, pkgs, ... }: { + system.stateVersion = "25.05"; + virtualisation.hypervGuest.enable = true; + boot.blacklistedKernelModules = [ "hyperv_fb" ]; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + environment.systemPackages = with pkgs; [ + cargo rustc just git wget gcc gnumake autoconf automake pkg-config cifs-utils + ]; + programs.nixvim.enable = true; + programs.nixvim.defaultEditor = true; + security.sudo.wheelNeedsPassword = false; + + networking.networkmanager.enable = true; + + time.timeZone = "Australia/Brisbane"; + users.users.aly = { + isNormalUser = true; + description = "aly"; + hashedPassword = "$y$j9T$Q.yFJjo9LMA8o.7Ac5uSr/$Y8pYIPSzCXHSd4nAlUohaaohwpquK6XEIjxFKq3J4s/"; + openssh.authorizedKeys.keys = import ../data/authorized_keys.nix; + extraGroups = [ "networkmanager" "wheel" ]; + }; + + services.openssh = { + enable = true; + settings = { + X11Forwarding = true; + PermitRootLogin = "no"; + PasswordAuthentication = true; + }; + openFirewall = true; + }; +})