diff --git a/SwarselSystems.org b/SwarselSystems.org index 73da2c5..24ed0c9 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -613,21 +613,29 @@ This section is the biggest pain point of the configuration. For every system, I ]; }; - winters = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; + nbl-imba-2 = lib.nixosSystem { + specialArgs = { inherit inputs outputs; }; modules = nixModules ++ [ - inputs.nixos-hardware.nixosModules.framework-16-inch-7040-amd - ./profiles/winters/nixos.nix - inputs.home-manager.nixosModules.home-manager - { - home-manager.users.swarsel.imports = mixedModules ++ [ - ./profiles/winters/home.nix - ]; - } + ./profiles/nbl-imba-2 ]; }; - nginx = nixpkgs.lib.nixosSystem { + # winters = nixpkgs.lib.nixosSystem { + # specialArgs = { inherit inputs; }; + # modules = nixModules ++ [ + # inputs.nixos-hardware.nixosModules.framework-16-inch-7040-amd + # ./profiles/winters/nixos.nix + # inputs.home-manager.nixosModules.home-manager + # { + # home-manager.users.swarsel.imports = mixedModules ++ [ + # ./profiles/winters/home.nix + # ]; + # } + # ]; + # }; + + nginx = nixpkgs.lib.nixos + System { specialArgs = { inherit inputs; }; modules = [ inputs.sops-nix.nixosModules.sops @@ -2130,6 +2138,119 @@ This is basically just adjusted to the core count, path to the =hwmon= (this was } +#+end_src + +**** nbl-imba-2 (Framework Laptop 16) +:PROPERTIES: +:CUSTOM_ID: h:6c6e9261-dfa1-42d8-ab2a-8b7c227be6d9 +:END: + +My work machine. + + +#+begin_src nix :tangle profiles/nbl-imba-2/default.nix + + { inputs, outputs, config, pkgs, ... }: + { + + imports = [ + inputs.nixos-hardware.nixosModules.framework-16-inch-7040-amd + + ./hardware-configuration.nix + + ../optional/nixos/steam.nix + ../optional/nixos/virtualbox.nix + ../optional/nixos/autologin.nix + ../optional/nixos/nswitch-rcm.nix + + inputs.home-manager.nixosModules.home-manager + { + home-manager.users.swarsel.imports = outputs.mixedModules ++ [ + ../optional/home/gaming.nix + ] ++ (builtins.attrValues outputs.homeManagerModules); + } + ] ++ (builtins.attrValues outputs.nixosModules); + + + nixpkgs = { + inherit (outputs) overlays; + config = { + allowUnfree = true; + }; + }; + + # boot = { + # loader.systemd-boot.enable = true; + # loader.efi.canTouchEfiVariables = true; + # kernelPackages = pkgs.linuxPackages_latest; + # }; + + + networking = { + hostName = "nbl-imba-2"; + fqdn = "nbl-imba-2.imp.univie.ac.at"; + firewall.enable = true; + }; + + hardware.graphics.extraPackages = with pkgs; [ + vulkan-loader + vulkan-validation-layers + vulkan-extension-layer + ]; + + services = { + fwupd.enable = true; + }; + + swarselsystems = { + wallpaper = ../../wallpaper/lenovowp.png; + hasBluetooth = true; + hasFingerprint = true; + initialSetup = true; + }; + + home-manager.users.swarsel.swarselsystems = { + isLaptop = true; + isNixos = true; + # temperatureHwmon = { + # isAbsolutePath = true; + # path = "/sys/devices/platform/thinkpad_hwmon/hwmon/"; + # input-filename = "temp1_input"; + # }; + # ------ ----- + # | DP-4 | |eDP-1| + # ------ ----- + # monitors = { + # main = { + # name = "California Institute of Technology 0x1407 Unknown"; + # mode = "1920x1080"; # TEMPLATE + # scale = "1"; + # position = "2560,0"; + # workspace = "2:二"; + # output = "eDP-1"; + # }; + # homedesktop = { + # name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320"; + # mode = "2560x1440"; + # scale = "1"; + # position = "0,0"; + # workspace = "1:一"; + # output = "DP-4"; + # }; + # }; + # inputs = { + # "1:1:AT_Translated_Set_2_keyboard" = { + # xkb_layout = "us"; + # xkb_options = "grp:win_space_toggle"; + # xkb_variant = "altgr-intl"; + # }; + # }; + keybindings = { + }; + }; + } + + #+end_src **** Winters (Framwork Laptop 16) @@ -4657,6 +4778,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a { wallpaper = import ./wallpaper.nix; hardware = import ./hardware.nix; + setup = import ./setup.nix; } #+end_src @@ -4691,6 +4813,16 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a } #+end_src +***** Hardware + +#+begin_src nix :tangle modules/nixos/setup.nix + { lib, ... }: + + { + options.swarselsystems.initialSetup = lib.mkEnableOption "initial setup (no sops keys available)"; + } +#+end_src + **** home-manager @@ -4830,7 +4962,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a options.swarselsystems.kyria = mkOption { type = types.attrsOf (types.attrsOf types.str ); default = { - "36125:53060:splitkb.com_Kyria_rev3" = { + "36125:53060:splitkb.com_splitkb.com_Kyria_rev3" = { xkb_layout = "us"; xkb_variant = "altgr-intl"; }; @@ -5016,14 +5148,14 @@ Next, we setup the keymap in case we are not in a graphical session. At this poi This ensures that all user-configuration happens here in the config file. #+begin_src nix :tangle profiles/common/nixos/users.nix - { pkgs, config, ... }: + { pkgs, config, lib, ... }: { users = { - mutableUsers = false; + mutableUsers = lib.mkIf (!config.swarselsystems.initialSetup) false; users.swarsel = { isNormalUser = true; description = "Leon S"; - hashedPasswordFile = config.sops.secrets.swarseluser.path; + hashedPasswordFile = lib.mkIf (!config.swarselsystems.initialSetup) config.sops.secrets.swarseluser.path; extraGroups = [ "networkmanager" "wheel" "lp" "audio" "video" "vboxusers" "scanner" ]; packages = with pkgs; [ ]; }; @@ -6064,6 +6196,7 @@ Programming languages and default lsp's are defined here: [[#h:0e7e8bea-ec58-499 picard-tools audacity sox + google-chrome # printing cups diff --git a/flake.nix b/flake.nix index 882d4d8..98f0b5d 100644 --- a/flake.nix +++ b/flake.nix @@ -212,27 +212,36 @@ ]; }; - winters = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; + nbl-imba-2 = lib.nixosSystem { + specialArgs = { inherit inputs outputs; }; modules = nixModules ++ [ - inputs.nixos-hardware.nixosModules.framework-16-inch-7040-amd - ./profiles/winters/nixos.nix - inputs.home-manager.nixosModules.home-manager - { - home-manager.users.swarsel.imports = mixedModules ++ [ - ./profiles/winters/home.nix - ]; - } + ./profiles/nbl-imba-2 ]; }; - nginx = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - modules = [ - inputs.sops-nix.nixosModules.sops - ./profiles/server1/nginx/nixos.nix - ]; - }; + # winters = nixpkgs.lib.nixosSystem { + # specialArgs = { inherit inputs; }; + # modules = nixModules ++ [ + # inputs.nixos-hardware.nixosModules.framework-16-inch-7040-amd + # ./profiles/winters/nixos.nix + # inputs.home-manager.nixosModules.home-manager + # { + # home-manager.users.swarsel.imports = mixedModules ++ [ + # ./profiles/winters/home.nix + # ]; + # } + # ]; + # }; + + nginx = nixpkgs.lib.nixos + System + { + specialArgs = { inherit inputs; }; + modules = [ + inputs.sops-nix.nixosModules.sops + ./profiles/server1/nginx/nixos.nix + ]; + }; calibre = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; diff --git a/modules/home/input.nix b/modules/home/input.nix index 28f4a5b..4029dd3 100644 --- a/modules/home/input.nix +++ b/modules/home/input.nix @@ -10,7 +10,7 @@ in options.swarselsystems.kyria = mkOption { type = types.attrsOf (types.attrsOf types.str); default = { - "36125:53060:splitkb.com_Kyria_rev3" = { + "36125:53060:splitkb.com_splitkb.com_Kyria_rev3" = { xkb_layout = "us"; xkb_variant = "altgr-intl"; }; diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index a580653..e86fdac 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -1,4 +1,5 @@ { wallpaper = import ./wallpaper.nix; hardware = import ./hardware.nix; + setup = import ./setup.nix; } diff --git a/modules/nixos/setup.nix b/modules/nixos/setup.nix new file mode 100644 index 0000000..ce5ea41 --- /dev/null +++ b/modules/nixos/setup.nix @@ -0,0 +1,5 @@ +{ lib, ... }: + +{ + options.swarselsystems.initialSetup = lib.mkEnableOption "initial setup (no sops keys available)"; +} diff --git a/profiles/common/home/packages.nix b/profiles/common/home/packages.nix index fb8c1ae..bbe1da1 100644 --- a/profiles/common/home/packages.nix +++ b/profiles/common/home/packages.nix @@ -12,6 +12,7 @@ picard-tools audacity sox + google-chrome # printing cups diff --git a/profiles/common/nixos/users.nix b/profiles/common/nixos/users.nix index 45f8046..fb9c3de 100644 --- a/profiles/common/nixos/users.nix +++ b/profiles/common/nixos/users.nix @@ -1,11 +1,11 @@ -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: { users = { - mutableUsers = false; + mutableUsers = lib.mkIf (!config.swarselsystems.initialSetup) false; users.swarsel = { isNormalUser = true; description = "Leon S"; - hashedPasswordFile = config.sops.secrets.swarseluser.path; + hashedPasswordFile = lib.mkIf (!config.swarselsystems.initialSetup) config.sops.secrets.swarseluser.path; extraGroups = [ "networkmanager" "wheel" "lp" "audio" "video" "vboxusers" "scanner" ]; packages = with pkgs; [ ]; }; diff --git a/profiles/nbl-imba-2/default.nix b/profiles/nbl-imba-2/default.nix new file mode 100644 index 0000000..ffe06d5 --- /dev/null +++ b/profiles/nbl-imba-2/default.nix @@ -0,0 +1,98 @@ +{ inputs, outputs, config, pkgs, ... }: +{ + + imports = [ + inputs.nixos-hardware.nixosModules.framework-16-inch-7040-amd + + ./hardware-configuration.nix + + ../optional/nixos/steam.nix + ../optional/nixos/virtualbox.nix + ../optional/nixos/autologin.nix + ../optional/nixos/nswitch-rcm.nix + + inputs.home-manager.nixosModules.home-manager + { + home-manager.users.swarsel.imports = outputs.mixedModules ++ [ + ../optional/home/gaming.nix + ] ++ (builtins.attrValues outputs.homeManagerModules); + } + ] ++ (builtins.attrValues outputs.nixosModules); + + + nixpkgs = { + inherit (outputs) overlays; + config = { + allowUnfree = true; + }; + }; + + # boot = { + # loader.systemd-boot.enable = true; + # loader.efi.canTouchEfiVariables = true; + # kernelPackages = pkgs.linuxPackages_latest; + # }; + + + networking = { + hostName = "nbl-imba-2"; + fqdn = "nbl-imba-2.imp.univie.ac.at"; + firewall.enable = true; + }; + + hardware.graphics.extraPackages = with pkgs; [ + vulkan-loader + vulkan-validation-layers + vulkan-extension-layer + ]; + + services = { + fwupd.enable = true; + }; + + swarselsystems = { + wallpaper = ../../wallpaper/lenovowp.png; + hasBluetooth = true; + hasFingerprint = true; + initialSetup = true; + }; + + home-manager.users.swarsel.swarselsystems = { + isLaptop = true; + isNixos = true; + # temperatureHwmon = { + # isAbsolutePath = true; + # path = "/sys/devices/platform/thinkpad_hwmon/hwmon/"; + # input-filename = "temp1_input"; + # }; + # ------ ----- + # | DP-4 | |eDP-1| + # ------ ----- + # monitors = { + # main = { + # name = "California Institute of Technology 0x1407 Unknown"; + # mode = "1920x1080"; # TEMPLATE + # scale = "1"; + # position = "2560,0"; + # workspace = "2:二"; + # output = "eDP-1"; + # }; + # homedesktop = { + # name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320"; + # mode = "2560x1440"; + # scale = "1"; + # position = "0,0"; + # workspace = "1:一"; + # output = "DP-4"; + # }; + # }; + # inputs = { + # "1:1:AT_Translated_Set_2_keyboard" = { + # xkb_layout = "us"; + # xkb_options = "grp:win_space_toggle"; + # xkb_variant = "altgr-intl"; + # }; + # }; + keybindings = { }; + }; +}