diff --git a/SwarselSystems.org b/SwarselSystems.org index 3a73652..540dd85 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -838,11 +838,6 @@ The rest of the outputs either define or help define the actual configurations: name = configName; secretsDir = ../hosts/nixos/${configName}/secrets; }; - - swarselprofiles = { - minimal = lib.mkIf minimal true; - }; - } ]; }; @@ -866,7 +861,6 @@ The rest of the outputs either define or help define the actual configurations: { node.name = configName; node.secretsDir = ../hosts/darwin/${configName}/secrets; - } ]; }; @@ -1778,70 +1772,78 @@ My work machine. Built for more security, this is the gold standard of my config let primaryUser = config.swarselsystems.mainUser; in - { + { - imports = [ - inputs.nixos-hardware.nixosModules.framework-16-7040-amd + imports = [ + inputs.nixos-hardware.nixosModules.framework-16-7040-amd - ./disk-config.nix - ./hardware-configuration.nix + ./disk-config.nix + ./hardware-configuration.nix - ]; + ]; - swarselprofiles = { - personal = lib.mkIf (!minimal) true; - work = lib.mkIf (!minimal) true; - framework = lib.mkIf (!minimal) true; - amdcpu = true; - amdgpu = true; - hibernation = true; - btrfs = true; - }; - swarselsystems = { - lowResolution = "1280x800"; - highResolution = "2560x1600"; - isLaptop = true; - isNixos = true; - isBtrfs = true; - isLinux = true; - sharescreen = "eDP-2"; - info = "Framework Laptop 16, 7940HS, RX7700S, 64GB RAM"; - firewall = lib.mkForce true; - wallpaper = self + /files/wallpaper/lenovowp.png; - hasBluetooth = true; - hasFingerprint = true; - isImpermanence = false; - isSecureBoot = true; - isCrypted = true; - inherit (config.repo.secrets.local) hostName; - inherit (config.repo.secrets.local) fqdn; - hibernation.offset = 533760; - }; - - home-manager.users."${primaryUser}" = { - swarselsystems = { - isSecondaryGpu = true; - SecondaryGpuCard = "pci-0000_03_00_0"; - cpuCount = 16; - temperatureHwmon = { - isAbsolutePath = true; - path = "/sys/devices/virtual/thermal/thermal_zone0/"; - input-filename = "temp4_input"; - }; - monitors = { - main = { - name = "BOE 0x0BC9 Unknown"; - mode = "2560x1600"; # TEMPLATE - scale = "1"; - position = "2560,0"; - workspace = "15:L"; - output = "eDP-2"; - }; - }; + swarselprofiles = { + personal = lib.mkIf (!minimal) true; + minimal = lib.mkIf minimal true; + work = lib.mkIf (!minimal) true; + framework = lib.mkIf (!minimal) true; + amdcpu = true; + amdgpu = true; + hibernation = true; + btrfs = true; }; - }; - } + swarselsystems = { + isLaptop = true; + isNixos = true; + isBtrfs = true; + isLinux = true; + sharescreen = "eDP-2"; + info = "Framework Laptop 16, 7940HS, RX7700S, 64GB RAM"; + firewall = lib.mkForce true; + wallpaper = self + /files/wallpaper/lenovowp.png; + hasBluetooth = true; + hasFingerprint = true; + isImpermanence = false; + isSecureBoot = true; + isCrypted = true; + inherit (config.repo.secrets.local) hostName; + inherit (config.repo.secrets.local) fqdn; + hibernation.offset = 533760; + }; + + home-manager.users."${primaryUser}" = { + # home.stateVersion = lib.mkForce "23.05"; + swarselprofiles = { + personal = lib.mkIf (!minimal) true; + minimal = lib.mkIf minimal true; + work = lib.mkIf (!minimal) true; + framework = lib.mkIf (!minimal) true; + }; + swarselsystems = { + isSecondaryGpu = true; + SecondaryGpuCard = "pci-0000_03_00_0"; + cpuCount = 16; + temperatureHwmon = { + isAbsolutePath = true; + path = "/sys/devices/virtual/thermal/thermal_zone0/"; + input-filename = "temp4_input"; + }; + lowResolution = "1280x800"; + highResolution = "2560x1600"; + monitors = { + main = { + name = "BOE 0x0BC9 Unknown"; + mode = "2560x1600"; # TEMPLATE + scale = "1"; + position = "2560,0"; + workspace = "15:L"; + output = "eDP-2"; + }; + }; + }; + }; + } @@ -3485,8 +3487,6 @@ This is the "reference implementation" of a setup that runs without NixOS, only inputs.sops-nix.homeManagerModules.sops inputs.nix-index-database.hmModules.nix-index "${self}/modules/home" - "${self}/modules/nixos/common/pii.nix" - "${self}/modules/nixos/common/meta.nix" ]; nixpkgs = { @@ -3971,18 +3971,18 @@ This section is for setting things that should be used on hosts that are using t #+begin_src nix-ts :tangle modules/home/common/sharedoptions.nix - { lib, config, nixosConfig ? null, ... }: - let - # mirrorAttrs = lib.mapAttrs (_: v: lib.mkDefault v) nixosConfig.swarselsystems; - inherit (lib) mkDefault mapAttrs filterAttrs; - mkDefaultCommonAttrs = base: defaults: - lib.mapAttrs (_: v: lib.mkDefault v) - (lib.filterAttrs (k: _: base ? ${k}) defaults); - in - { - # config.swarselsystems = mirrorAttrs; - config.swarselsystems = lib.mkIf (nixosConfig != null) (mkDefaultCommonAttrs config.swarselsystems nixosConfig.swarselsystems); - } + { lib, config, nixosConfig, ... }: + let + # mirrorAttrs = lib.mapAttrs (_: v: lib.mkDefault v) nixosConfig.swarselsystems; + inherit (lib) mkDefault mapAttrs filterAttrs; + mkDefaultCommonAttrs = base: defaults: + lib.mapAttrs (_: v: lib.mkDefault v) + (lib.filterAttrs (k: _: base ? ${k}) defaults); + in + { + # config.swarselsystems = mirrorAttrs; + config.swarselsystems = mkDefaultCommonAttrs config.swarselsystems nixosConfig.swarselsystems; + } #+end_src **** Topology (automatically active) @@ -4166,11 +4166,8 @@ We enable the use of =home-manager= as a NixoS module. A nice trick here is the imports = [ "${self}/profiles/home" "${self}/modules/home" - { - swarselprofiles = { - minimal = lib.mkIf minimal true; - }; - } + # "${self}/modules/nixos/common/pii.nix" + # "${self}/modules/nixos/common/meta.nix" ]; # node = { # secretsDir = if (!config.swarselsystems.isNixos) then ../../../hosts/home/${configName}/secrets else ../../../hosts/nixos/${configName}/secrets; @@ -11075,7 +11072,7 @@ I use sops-nix to handle secrets that I want to have available on my machines at :END: #+begin_src nix-ts :tangle modules/home/common/yubikey.nix - { lib, config, nixosConfig ? config, ... }: + { lib, config, nixosConfig, ... }: let inherit (config.swarselsystems) homeDir; in @@ -11352,7 +11349,7 @@ Also in firefox `about:config > toolkit.legacyUserProfileCustomizations.styleshe Sets environment variables. Here I am only setting the EDITOR variable, most variables are set in the [[#h:02df9dfc-d1af-4a37-a7a0-d8da0af96a20][Sway]] section. #+begin_src nix-ts :tangle modules/home/common/env.nix - { lib, config, globals, nixosConfig ? config, ... }: + { lib, config, globals, nixosConfig, ... }: let inherit (nixosConfig.repo.secrets.common.mail) address1 address2 address3 address4 allMailAddresses; inherit (nixosConfig.repo.secrets.common) fullName; @@ -11558,7 +11555,7 @@ Eza provides me with a better =ls= command and some other useful aliases. Here I set up my git config, automatic signing of commits, useful aliases for my ost used commands (for when I am not using [[#h:d2c7323d-f8c6-4f23-b70a-930e3e4ecce5][Magit]]) as well as a git template defined in [[#h:5ef03803-e150-41bc-b603-e80d60d96efc][Linking dotfiles]]. #+begin_src nix-ts :tangle modules/home/common/git.nix - { lib, config, globals, minimal, nixosConfig ? config, ... }: + { lib, config, globals, minimal, nixosConfig, ... }: let inherit (nixosConfig.repo.secrets.common.mail) address1; inherit (nixosConfig.repo.secrets.common) fullName; @@ -12099,7 +12096,7 @@ Currently I only use it as before with =initExtra= though. Normally I use 4 mail accounts - here I set them all up. Three of them are Google accounts (sadly), which are a chore to setup. The last is just a sender account that I setup SMTP for here. #+begin_src nix-ts :tangle modules/home/common/mail.nix - { lib, config, nixosConfig ? config, ... }: + { lib, config, nixosConfig, ... }: let inherit (nixosConfig.repo.secrets.common.mail) address1 address2 address2-name address3 address3-name address4 address4-user address4-host; inherit (nixosConfig.repo.secrets.common) fullName; @@ -13578,7 +13575,7 @@ Settinfs that are needed for the gpg-agent. Also we are enabling emacs support f This service changes the screen hue at night. I am not sure if that really does something, but I like the color anyways. #+begin_src nix-ts :tangle modules/home/common/gammastep.nix - { lib, config, nixosConfig ? config, ... }: + { lib, config, nixosConfig, ... }: let inherit (nixosConfig.repo.secrets.common.location) latitude longitude; in @@ -13741,7 +13738,7 @@ The rest of the settings is at [[#h:fb3f3e01-7df4-4b06-9e91-aa9cac61a431][gaming The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]]. Here, I am setting up the different firefox profiles that I need for the SSO sites that I need to access at work as well as a few ssh shorthands. #+begin_src nix-ts :tangle modules/home/optional/work.nix :noweb yes - { self, config, pkgs, lib, nixosConfig ? config, ... }: + { self, config, pkgs, lib, nixosConfig, ... }: let inherit (config.swarselsystems) homeDir; in @@ -16123,7 +16120,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a :END: #+begin_src nix-ts :tangle profiles/nixos/personal/default.nix :mkdirp yes - { lib, config, minimal, ... }: + { lib, config, ... }: { options.swarselprofiles.personal = lib.mkEnableOption "is this a personal host"; config = lib.mkIf config.swarselprofiles.personal { @@ -16180,11 +16177,6 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a ssh = lib.mkDefault true; }; }; - home-manager.users."${config.swarselsystems.mainUser}" = { - swarselprofiles = { - personal = lib.mkIf (!minimal) true; - }; - }; }; @@ -16389,7 +16381,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a :END: #+begin_src nix-ts :tangle profiles/nixos/work/default.nix :mkdirp yes - { lib, config, minimal, ... }: + { lib, config, ... }: { options.swarselprofiles.work = lib.mkEnableOption "is this a work host"; config = lib.mkIf config.swarselprofiles.work { @@ -16398,11 +16390,6 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a work = lib.mkDefault true; }; }; - home-manager.users."${config.swarselsystems.mainUser}" = { - swarselprofiles = { - work = lib.mkIf (!minimal) true; - }; - }; }; @@ -16416,7 +16403,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a :END: #+begin_src nix-ts :tangle profiles/nixos/framework/default.nix :mkdirp yes - { lib, config, minimal, ... }: + { lib, config, ... }: { options.swarselprofiles.framework = lib.mkEnableOption "is this a framework brand host"; config = lib.mkIf config.swarselprofiles.framework { @@ -16425,11 +16412,6 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a framework = lib.mkDefault true; }; }; - home-manager.users."${config.swarselsystems.mainUser}" = { - swarselprofiles = { - framework = lib.mkIf (!minimal) true; - }; - }; }; diff --git a/hosts/home/treehouse/default.nix b/hosts/home/treehouse/default.nix index 9ce0edf..9f2b3e4 100644 --- a/hosts/home/treehouse/default.nix +++ b/hosts/home/treehouse/default.nix @@ -6,8 +6,6 @@ inputs.sops-nix.homeManagerModules.sops inputs.nix-index-database.hmModules.nix-index "${self}/modules/home" - "${self}/modules/nixos/common/pii.nix" - "${self}/modules/nixos/common/meta.nix" ]; nixpkgs = { diff --git a/hosts/nixos/pyramid/default.nix b/hosts/nixos/pyramid/default.nix index 79541c3..5184a96 100644 --- a/hosts/nixos/pyramid/default.nix +++ b/hosts/nixos/pyramid/default.nix @@ -15,6 +15,7 @@ in swarselprofiles = { personal = lib.mkIf (!minimal) true; + minimal = lib.mkIf minimal true; work = lib.mkIf (!minimal) true; framework = lib.mkIf (!minimal) true; amdcpu = true; @@ -23,8 +24,6 @@ in btrfs = true; }; swarselsystems = { - lowResolution = "1280x800"; - highResolution = "2560x1600"; isLaptop = true; isNixos = true; isBtrfs = true; @@ -44,6 +43,13 @@ in }; home-manager.users."${primaryUser}" = { + # home.stateVersion = lib.mkForce "23.05"; + swarselprofiles = { + personal = lib.mkIf (!minimal) true; + minimal = lib.mkIf minimal true; + work = lib.mkIf (!minimal) true; + framework = lib.mkIf (!minimal) true; + }; swarselsystems = { isSecondaryGpu = true; SecondaryGpuCard = "pci-0000_03_00_0"; @@ -53,6 +59,8 @@ in path = "/sys/devices/virtual/thermal/thermal_zone0/"; input-filename = "temp4_input"; }; + lowResolution = "1280x800"; + highResolution = "2560x1600"; monitors = { main = { name = "BOE 0x0BC9 Unknown"; diff --git a/modules/home/common/env.nix b/modules/home/common/env.nix index 629acac..e4d9da2 100644 --- a/modules/home/common/env.nix +++ b/modules/home/common/env.nix @@ -1,4 +1,4 @@ -{ lib, config, globals, nixosConfig ? config, ... }: +{ lib, config, globals, nixosConfig, ... }: let inherit (nixosConfig.repo.secrets.common.mail) address1 address2 address3 address4 allMailAddresses; inherit (nixosConfig.repo.secrets.common) fullName; diff --git a/modules/home/common/gammastep.nix b/modules/home/common/gammastep.nix index c8862c8..1109d75 100644 --- a/modules/home/common/gammastep.nix +++ b/modules/home/common/gammastep.nix @@ -1,4 +1,4 @@ -{ lib, config, nixosConfig ? config, ... }: +{ lib, config, nixosConfig, ... }: let inherit (nixosConfig.repo.secrets.common.location) latitude longitude; in diff --git a/modules/home/common/git.nix b/modules/home/common/git.nix index 59035aa..4f522f5 100644 --- a/modules/home/common/git.nix +++ b/modules/home/common/git.nix @@ -1,4 +1,4 @@ -{ lib, config, globals, minimal, nixosConfig ? config, ... }: +{ lib, config, globals, minimal, nixosConfig, ... }: let inherit (nixosConfig.repo.secrets.common.mail) address1; inherit (nixosConfig.repo.secrets.common) fullName; diff --git a/modules/home/common/mail.nix b/modules/home/common/mail.nix index cc14121..77e67d4 100644 --- a/modules/home/common/mail.nix +++ b/modules/home/common/mail.nix @@ -1,4 +1,4 @@ -{ lib, config, nixosConfig ? config, ... }: +{ lib, config, nixosConfig, ... }: let inherit (nixosConfig.repo.secrets.common.mail) address1 address2 address2-name address3 address3-name address4 address4-user address4-host; inherit (nixosConfig.repo.secrets.common) fullName; diff --git a/modules/home/common/sharedoptions.nix b/modules/home/common/sharedoptions.nix index 8edb073..343518f 100644 --- a/modules/home/common/sharedoptions.nix +++ b/modules/home/common/sharedoptions.nix @@ -1,4 +1,4 @@ -{ lib, config, nixosConfig ? null, ... }: +{ lib, config, nixosConfig, ... }: let # mirrorAttrs = lib.mapAttrs (_: v: lib.mkDefault v) nixosConfig.swarselsystems; inherit (lib) mkDefault mapAttrs filterAttrs; @@ -8,5 +8,5 @@ let in { # config.swarselsystems = mirrorAttrs; - config.swarselsystems = lib.mkIf (nixosConfig != null) (mkDefaultCommonAttrs config.swarselsystems nixosConfig.swarselsystems); + config.swarselsystems = mkDefaultCommonAttrs config.swarselsystems nixosConfig.swarselsystems; } diff --git a/modules/home/common/yubikey.nix b/modules/home/common/yubikey.nix index 40c52cd..61224f1 100644 --- a/modules/home/common/yubikey.nix +++ b/modules/home/common/yubikey.nix @@ -1,4 +1,4 @@ -{ lib, config, nixosConfig ? config, ... }: +{ lib, config, nixosConfig, ... }: let inherit (config.swarselsystems) homeDir; in diff --git a/modules/home/optional/work.nix b/modules/home/optional/work.nix index 7c88a65..0de809b 100644 --- a/modules/home/optional/work.nix +++ b/modules/home/optional/work.nix @@ -1,4 +1,4 @@ -{ self, config, pkgs, lib, nixosConfig ? config, ... }: +{ self, config, pkgs, lib, nixosConfig, ... }: let inherit (config.swarselsystems) homeDir; in diff --git a/modules/nixos/common/home-manager.nix b/modules/nixos/common/home-manager.nix index 2c1dcf1..04ba4f6 100644 --- a/modules/nixos/common/home-manager.nix +++ b/modules/nixos/common/home-manager.nix @@ -14,11 +14,8 @@ imports = [ "${self}/profiles/home" "${self}/modules/home" - { - swarselprofiles = { - minimal = lib.mkIf minimal true; - }; - } + # "${self}/modules/nixos/common/pii.nix" + # "${self}/modules/nixos/common/meta.nix" ]; # node = { # secretsDir = if (!config.swarselsystems.isNixos) then ../../../hosts/home/${configName}/secrets else ../../../hosts/nixos/${configName}/secrets; diff --git a/nix/hosts.nix b/nix/hosts.nix index 421618a..192c521 100644 --- a/nix/hosts.nix +++ b/nix/hosts.nix @@ -26,11 +26,6 @@ name = configName; secretsDir = ../hosts/nixos/${configName}/secrets; }; - - swarselprofiles = { - minimal = lib.mkIf minimal true; - }; - } ]; }; @@ -54,7 +49,6 @@ { node.name = configName; node.secretsDir = ../hosts/darwin/${configName}/secrets; - } ]; }; diff --git a/profiles/nixos/framework/default.nix b/profiles/nixos/framework/default.nix index 32b6b0e..b4c28e2 100644 --- a/profiles/nixos/framework/default.nix +++ b/profiles/nixos/framework/default.nix @@ -1,4 +1,4 @@ -{ lib, config, minimal, ... }: +{ lib, config, ... }: { options.swarselprofiles.framework = lib.mkEnableOption "is this a framework brand host"; config = lib.mkIf config.swarselprofiles.framework { @@ -7,11 +7,6 @@ framework = lib.mkDefault true; }; }; - home-manager.users."${config.swarselsystems.mainUser}" = { - swarselprofiles = { - framework = lib.mkIf (!minimal) true; - }; - }; }; diff --git a/profiles/nixos/personal/default.nix b/profiles/nixos/personal/default.nix index 27076c8..f29e106 100644 --- a/profiles/nixos/personal/default.nix +++ b/profiles/nixos/personal/default.nix @@ -1,4 +1,4 @@ -{ lib, config, minimal, ... }: +{ lib, config, ... }: { options.swarselprofiles.personal = lib.mkEnableOption "is this a personal host"; config = lib.mkIf config.swarselprofiles.personal { @@ -55,11 +55,6 @@ ssh = lib.mkDefault true; }; }; - home-manager.users."${config.swarselsystems.mainUser}" = { - swarselprofiles = { - personal = lib.mkIf (!minimal) true; - }; - }; }; diff --git a/profiles/nixos/work/default.nix b/profiles/nixos/work/default.nix index 6ab95d8..0894635 100644 --- a/profiles/nixos/work/default.nix +++ b/profiles/nixos/work/default.nix @@ -1,4 +1,4 @@ -{ lib, config, minimal, ... }: +{ lib, config, ... }: { options.swarselprofiles.work = lib.mkEnableOption "is this a work host"; config = lib.mkIf config.swarselprofiles.work { @@ -7,11 +7,6 @@ work = lib.mkDefault true; }; }; - home-manager.users."${config.swarselsystems.mainUser}" = { - swarselprofiles = { - work = lib.mkIf (!minimal) true; - }; - }; };