From 23485c3c73f660d11988363c14347bc6c3031d7d Mon Sep 17 00:00:00 2001 From: Chris Kruining Date: Sun, 21 Jul 2024 14:26:30 +0200 Subject: [PATCH] moved around the hosts --- default.nix | 1 + flake.nix | 2 +- hosts/chris-laptop/default.nix | 40 +++++++++++++++++ hosts/{chris/pc => chris-pc}/default.nix | 2 +- hosts/{chris/pc => chris-pc}/default.nix.back | 0 .../hardware-configuration.nix | 0 hosts/chris-server/default.nix | 43 +++++++++++++++++++ hosts/chris-server/hardware-configuration.nix | 38 ++++++++++++++++ hosts/chris/laptop/default.nix | 2 - hosts/chris/server/default.nix | 2 - hosts/mam-laptop/default.nix | 40 +++++++++++++++++ lib/nixos.nix | 4 +- 12 files changed, 166 insertions(+), 8 deletions(-) create mode 100644 hosts/chris-laptop/default.nix rename hosts/{chris/pc => chris-pc}/default.nix (94%) rename hosts/{chris/pc => chris-pc}/default.nix.back (100%) rename hosts/{chris/pc => chris-pc}/hardware-configuration.nix (100%) create mode 100644 hosts/chris-server/default.nix create mode 100644 hosts/chris-server/hardware-configuration.nix delete mode 100644 hosts/chris/laptop/default.nix delete mode 100644 hosts/chris/server/default.nix create mode 100644 hosts/mam-laptop/default.nix diff --git a/default.nix b/default.nix index b127f53..910d7ac 100644 --- a/default.nix +++ b/default.nix @@ -8,6 +8,7 @@ in { imports = [ inputs.home-manager.nixosModules.home-manager + inputs.stylix.nixosModules.stylix (mkAliasOptionModule ["hm"] ["home-manager" "users" config.user.name]) ] ++ (mapModulesRec' (toString ./modules) import); diff --git a/flake.nix b/flake.nix index b8bd6a5..9ab358b 100644 --- a/flake.nix +++ b/flake.nix @@ -41,7 +41,7 @@ nixosModules = { - chris = import ./.; + kaas = import ./.; } // mapModulesRec ./modules import; diff --git a/hosts/chris-laptop/default.nix b/hosts/chris-laptop/default.nix new file mode 100644 index 0000000..15423bf --- /dev/null +++ b/hosts/chris-laptop/default.nix @@ -0,0 +1,40 @@ +{ config, lib, pkgs, ... }: +{ + imports = [ ./hardware-configuration.nix ]; + + modules = { + themes.active = "everforrest"; + + networking.enable = true; + + desktop = { + plasma.enable = true; + + terminal = { + default = "alacritty"; + allacrity.enable = true; + }; + + editors = { + default = "nano"; + nano.enable = true; + }; + + browsers = { + default = "firefox"; + firefox.enable = true; + firefox.privacy.enable = true; + }; + }; + + shell = { + default = "zsh"; + }; + }; + + programs.kdeconnect = { + enable = true; + package = pkgs.valent; + }; +} + diff --git a/hosts/chris/pc/default.nix b/hosts/chris-pc/default.nix similarity index 94% rename from hosts/chris/pc/default.nix rename to hosts/chris-pc/default.nix index b5d287c..b5a7d63 100644 --- a/hosts/chris/pc/default.nix +++ b/hosts/chris-pc/default.nix @@ -5,7 +5,7 @@ modules = { themes.active = "everforrest"; - networking.networkManager.enable = true; + networking.enable = true; develop = { rust.enable = true; diff --git a/hosts/chris/pc/default.nix.back b/hosts/chris-pc/default.nix.back similarity index 100% rename from hosts/chris/pc/default.nix.back rename to hosts/chris-pc/default.nix.back diff --git a/hosts/chris/pc/hardware-configuration.nix b/hosts/chris-pc/hardware-configuration.nix similarity index 100% rename from hosts/chris/pc/hardware-configuration.nix rename to hosts/chris-pc/hardware-configuration.nix diff --git a/hosts/chris-server/default.nix b/hosts/chris-server/default.nix new file mode 100644 index 0000000..f2103f7 --- /dev/null +++ b/hosts/chris-server/default.nix @@ -0,0 +1,43 @@ +{ config, lib, pkgs, ... }: +{ + imports = [ ./hardware-configuration.nix ]; + + modules = { + themes.active = "everforrest"; + + networking.enable = true; + + services = { + enable = true; + media.enable = true; + }; + + desktop = { + plasma.enable = true; + + terminal = { + default = "alacritty"; + allacrity.enable = true; + }; + + editors = { + default = "nano"; + nano.enable = true; + }; + }; + + shell = { + default = "zsh"; + toolset = { + git.enable = true; + gnupg.enable = true; + }; + }; + }; + + programs.kdeconnect = { + enable = true; + package = pkgs.valent; + }; +} + diff --git a/hosts/chris-server/hardware-configuration.nix b/hosts/chris-server/hardware-configuration.nix new file mode 100644 index 0000000..dad81c9 --- /dev/null +++ b/hosts/chris-server/hardware-configuration.nix @@ -0,0 +1,38 @@ +# 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 = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/dd518f17-61c9-4831-b1bd-e1cc2af292aa"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/0A56-EBFE"; + 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.enp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/chris/laptop/default.nix b/hosts/chris/laptop/default.nix deleted file mode 100644 index 6416a04..0000000 --- a/hosts/chris/laptop/default.nix +++ /dev/null @@ -1,2 +0,0 @@ -{}: -{} diff --git a/hosts/chris/server/default.nix b/hosts/chris/server/default.nix deleted file mode 100644 index 6416a04..0000000 --- a/hosts/chris/server/default.nix +++ /dev/null @@ -1,2 +0,0 @@ -{}: -{} diff --git a/hosts/mam-laptop/default.nix b/hosts/mam-laptop/default.nix new file mode 100644 index 0000000..15423bf --- /dev/null +++ b/hosts/mam-laptop/default.nix @@ -0,0 +1,40 @@ +{ config, lib, pkgs, ... }: +{ + imports = [ ./hardware-configuration.nix ]; + + modules = { + themes.active = "everforrest"; + + networking.enable = true; + + desktop = { + plasma.enable = true; + + terminal = { + default = "alacritty"; + allacrity.enable = true; + }; + + editors = { + default = "nano"; + nano.enable = true; + }; + + browsers = { + default = "firefox"; + firefox.enable = true; + firefox.privacy.enable = true; + }; + }; + + shell = { + default = "zsh"; + }; + }; + + programs.kdeconnect = { + enable = true; + package = pkgs.valent; + }; +} + diff --git a/lib/nixos.nix b/lib/nixos.nix index 94312eb..a119c34 100644 --- a/lib/nixos.nix +++ b/lib/nixos.nix @@ -25,6 +25,6 @@ in rec ]; }; - mapHosts = dir: attrs @ { system ? system, ... }: - mapModules dir (hostPath: mkHost hostPath attrs); + mapHosts = dir: attrs @ { system ? system, ... }: + mapModules dir (hostPath: mkHost hostPath attrs); }