diff --git a/.gitignore b/.gitignore index a511cc36a..00fd7e937 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,5 @@ node_modules .direnv/* result .ccls-cache -flake .pre-commit-config.yaml .venv diff --git a/checks/deploy/default.nix b/checks/deploy/default.nix deleted file mode 100644 index 84b64a8b4..000000000 --- a/checks/deploy/default.nix +++ /dev/null @@ -1,2 +0,0 @@ -{ inputs, ... }: -builtins.mapAttrs (_: deployLib: deployLib.deployChecks inputs.self.deploy) inputs.deploy-rs.lib diff --git a/checks/pre-commit-hooks/default.nix b/checks/pre-commit-hooks/default.nix deleted file mode 100644 index 8be054eed..000000000 --- a/checks/pre-commit-hooks/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - inputs, - pkgs, - ... -}: -let - inherit (inputs) git-hooks-nix; -in -git-hooks-nix.lib.${pkgs.system}.run { - src = ./.; - hooks = { - clang-tidy.enable = true; - luacheck.enable = true; - pre-commit-hook-ensure-sops.enable = true; - treefmt = { - enable = true; - settings.fail-on-change = false; - packageOverrides.treefmt = inputs.treefmt-nix.lib.mkWrapper pkgs ../../treefmt.nix; - }; - }; -} diff --git a/systems/aarch64-darwin/khanelimac/default.nix b/configurations/darwin/khanelimac/default.nix similarity index 81% rename from systems/aarch64-darwin/khanelimac/default.nix rename to configurations/darwin/khanelimac/default.nix index 98ecbd12e..dfee47a64 100644 --- a/systems/aarch64-darwin/khanelimac/default.nix +++ b/configurations/darwin/khanelimac/default.nix @@ -1,15 +1,19 @@ { - lib, config, - namespace, + inputs, + lib, + root, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) enabled; + inherit (khanelinix-lib) enabled; - cfg = config.${namespace}.user; + cfg = config.khanelinix.user; in { + imports = lib.optional (inputs.sops-nix ? darwinModules) inputs.sops-nix.darwinModules.sops; + khanelinix = { archetypes = { personal = enabled; @@ -20,7 +24,7 @@ in sops = { enable = true; sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; - defaultSopsFile = lib.snowfall.fs.get-file "secrets/khanelimac/default.yaml"; + defaultSopsFile = root + "/secrets/khanelimac/default.yaml"; }; }; @@ -72,5 +76,9 @@ in }; }; + nixpkgs.hostPlatform = { + system = "aarch64-darwin"; + }; + system.stateVersion = 5; } diff --git a/homes/x86_64-linux/bruddy@bruddynix/default.nix b/configurations/home/bruddy@bruddynix/default.nix similarity index 93% rename from homes/x86_64-linux/bruddy@bruddynix/default.nix rename to configurations/home/bruddy@bruddynix/default.nix index 83b710c19..68f10fc29 100644 --- a/homes/x86_64-linux/bruddy@bruddynix/default.nix +++ b/configurations/home/bruddy@bruddynix/default.nix @@ -1,10 +1,9 @@ { - lib, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) enabled disabled; + inherit (khanelinix-lib) enabled disabled; in { khanelinix = { @@ -79,7 +78,7 @@ in # sops = { # enable = true; - # defaultSopsFile = lib.snowfall.fs.get-file "secrets/khanelinix/khaneliman/default.yaml"; + # defaultSopsFile = root + "/secrets/khanelinix/khaneliman/default.yaml"; # sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ]; # }; }; diff --git a/homes/aarch64-darwin/khaneliman@khanelimac/default.nix b/configurations/home/khaneliman@khanelimac/default.nix similarity index 88% rename from homes/aarch64-darwin/khaneliman@khanelimac/default.nix rename to configurations/home/khaneliman@khanelimac/default.nix index dd98aa9c5..2e98f4cde 100644 --- a/homes/aarch64-darwin/khaneliman@khanelimac/default.nix +++ b/configurations/home/khaneliman@khanelimac/default.nix @@ -1,12 +1,13 @@ { config, lib, - namespace, + root, + khanelinix-lib, ... }: let inherit (lib) mkForce; - inherit (lib.${namespace}) enabled disabled; + inherit (khanelinix-lib) enabled disabled; in { khanelinix = { @@ -23,8 +24,8 @@ in extraAccounts = let # Not super secret, just doesn't need to be scraped so easily. - outlook = lib.${namespace}.decode "a2hhbmVsaW1hbjEyQG91dGxvb2suY29t"; - personal = lib.${namespace}.decode "YXVzdGluLm0uaG9yc3RtYW5AZ21haWwuY29t"; + outlook = khanelinix-lib.decode "a2hhbmVsaW1hbjEyQG91dGxvb2suY29t"; + personal = khanelinix-lib.decode "YXVzdGluLm0uaG9yc3RtYW5AZ21haWwuY29t"; in { @@ -84,7 +85,7 @@ in services = { sops = { enable = true; - defaultSopsFile = lib.snowfall.fs.get-file "secrets/khanelimac/khaneliman/default.yaml"; + defaultSopsFile = root + "/secrets/khanelimac/khaneliman/default.yaml"; sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ]; }; }; diff --git a/homes/x86_64-linux/khaneliman@khanelinix/default.nix b/configurations/home/khaneliman@khanelinix/default.nix similarity index 82% rename from homes/x86_64-linux/khaneliman@khanelinix/default.nix rename to configurations/home/khaneliman@khanelinix/default.nix index a912080f8..f3ff92cdd 100644 --- a/homes/x86_64-linux/khaneliman@khanelinix/default.nix +++ b/configurations/home/khaneliman@khanelinix/default.nix @@ -2,12 +2,15 @@ config, lib, pkgs, - namespace, + root, + khanelinix-lib, + self, + system, ... }: let inherit (lib) getExe; - inherit (lib.${namespace}) enabled; + inherit (khanelinix-lib) enabled; in { khanelinix = { @@ -25,8 +28,8 @@ in extraAccounts = let # Not super secret, just doesn't need to be scraped so easily. - outlook = lib.${namespace}.decode "a2hhbmVsaW1hbjEyQG91dGxvb2suY29t"; - personal = lib.${namespace}.decode "YXVzdGluLm0uaG9yc3RtYW5AZ21haWwuY29t"; + outlook = khanelinix-lib.decode "a2hhbmVsaW1hbjEyQG91dGxvb2suY29t"; + personal = khanelinix-lib.decode "YXVzdGluLm0uaG9yc3RtYW5AZ21haWwuY29t"; in { @@ -74,9 +77,7 @@ in appendConfig = # bash '' - exec-once = hyprctl setcursor ${config.${namespace}.theme.gtk.cursor.name} ${ - builtins.toString config.${namespace}.theme.gtk.cursor.size - } + exec-once = hyprctl setcursor ${config.khanelinix.theme.gtk.cursor.name} ${builtins.toString config.khanelinix.theme.gtk.cursor.size} ''; prependConfig = # bash @@ -190,23 +191,23 @@ in monitors = [ { name = "DP-3"; - wallpaper = "${pkgs.${namespace}.wallpapers}/share/wallpapers/cat_pacman.png"; + wallpaper = "${self.packages.${system}.wallpapers}/share/wallpapers/cat_pacman.png"; } { name = "DP-1"; - wallpaper = "${pkgs.${namespace}.wallpapers}/share/wallpapers/cat-sound.png"; + wallpaper = "${self.packages.${system}.wallpapers}/share/wallpapers/cat-sound.png"; } ]; wallpapers = [ - "${pkgs.${namespace}.wallpapers}/share/wallpapers/buttons.png" - "${pkgs.${namespace}.wallpapers}/share/wallpapers/cat_pacman.png" - "${pkgs.${namespace}.wallpapers}/share/wallpapers/cat-sound.png" - "${pkgs.${namespace}.wallpapers}/share/wallpapers/flatppuccin_macchiato.png" - "${pkgs.${namespace}.wallpapers}/share/wallpapers/hashtags-black.png" - "${pkgs.${namespace}.wallpapers}/share/wallpapers/hashtags-new.png" - "${pkgs.${namespace}.wallpapers}/share/wallpapers/hearts.png" - "${pkgs.${namespace}.wallpapers}/share/wallpapers/tetris.png" + "${self.packages.${system}.wallpapers}/share/wallpapers/buttons.png" + "${self.packages.${system}.wallpapers}/share/wallpapers/cat_pacman.png" + "${self.packages.${system}.wallpapers}/share/wallpapers/cat-sound.png" + "${self.packages.${system}.wallpapers}/share/wallpapers/flatppuccin_macchiato.png" + "${self.packages.${system}.wallpapers}/share/wallpapers/hashtags-black.png" + "${self.packages.${system}.wallpapers}/share/wallpapers/hashtags-new.png" + "${self.packages.${system}.wallpapers}/share/wallpapers/hearts.png" + "${self.packages.${system}.wallpapers}/share/wallpapers/tetris.png" ]; }; @@ -218,7 +219,7 @@ in sops = { enable = true; - defaultSopsFile = lib.snowfall.fs.get-file "secrets/khanelinix/khaneliman/default.yaml"; + defaultSopsFile = root + "/secrets/khanelinix/khaneliman/default.yaml"; sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ]; }; }; diff --git a/homes/x86_64-linux/khaneliman@nixos/default.nix b/configurations/home/khaneliman@nixos/default.nix similarity index 78% rename from homes/x86_64-linux/khaneliman@nixos/default.nix rename to configurations/home/khaneliman@nixos/default.nix index 188ddbac4..5e08746d6 100644 --- a/homes/x86_64-linux/khaneliman@nixos/default.nix +++ b/configurations/home/khaneliman@nixos/default.nix @@ -1,11 +1,11 @@ { config, - lib, - namespace, + root, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) enabled; + inherit (khanelinix-lib) enabled; in { khanelinix = { @@ -26,7 +26,7 @@ in services = { sops = { enable = true; - defaultSopsFile = lib.snowfall.fs.get-file "secrets/khanelinix/khaneliman/default.yaml"; + defaultSopsFile = root + "/secrets/khanelinix/khaneliman/default.yaml"; sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ]; }; }; diff --git a/homes/x86_64-linux/nixos@CORE-PW00LM92/default.nix b/configurations/home/nixos@CORE-PW00LM92/default.nix similarity index 86% rename from homes/x86_64-linux/nixos@CORE-PW00LM92/default.nix rename to configurations/home/nixos@CORE-PW00LM92/default.nix index ceb4d17d1..26d9ab9eb 100644 --- a/homes/x86_64-linux/nixos@CORE-PW00LM92/default.nix +++ b/configurations/home/nixos@CORE-PW00LM92/default.nix @@ -1,13 +1,14 @@ { config, lib, - namespace, osConfig, + root, + khanelinix-lib, ... }: let inherit (lib) mkForce; - inherit (lib.${namespace}) enabled disabled; + inherit (khanelinix-lib) enabled disabled; in { khanelinix = { @@ -49,7 +50,7 @@ in services = { sops = { enable = true; - defaultSopsFile = lib.snowfall.fs.get-file "secrets/CORE/nixos/default.yaml"; + defaultSopsFile = root + "/secrets/CORE/nixos/default.yaml"; sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ]; }; }; @@ -71,7 +72,7 @@ in theme.catppuccin = enabled; }; - sops.secrets = lib.mkIf osConfig.${namespace}.security.sops.enable { + sops.secrets = lib.mkIf osConfig.khanelinix.security.sops.enable { kubernetes = { path = "${config.home.homeDirectory}/.kube/config"; }; diff --git a/homes/x86_64-linux/nixos@CORE-PW00LM92/git/windows-compat-config b/configurations/home/nixos@CORE-PW00LM92/git/windows-compat-config similarity index 100% rename from homes/x86_64-linux/nixos@CORE-PW00LM92/git/windows-compat-config rename to configurations/home/nixos@CORE-PW00LM92/git/windows-compat-config diff --git a/systems/x86_64-linux/CORE-PW00LM92/default.nix b/configurations/nixos/CORE-PW00LM92/default.nix similarity index 59% rename from systems/x86_64-linux/CORE-PW00LM92/default.nix rename to configurations/nixos/CORE-PW00LM92/default.nix index 88b11c263..22e91e8c5 100644 --- a/systems/x86_64-linux/CORE-PW00LM92/default.nix +++ b/configurations/nixos/CORE-PW00LM92/default.nix @@ -1,7 +1,7 @@ -{ lib, namespace, ... }: +{ lib, khanelinix-lib, ... }: let inherit (lib) mkForce; - inherit (lib.${namespace}) enabled disabled; + inherit (khanelinix-lib) enabled disabled; in { imports = [ ./hardware.nix ]; @@ -46,11 +46,9 @@ in }; }; - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + nixpkgs.hostPlatform = { + system = "x86_64-linux"; + }; + system.stateVersion = "23.11"; # Did you read the comment? } diff --git a/systems/x86_64-linux/CORE-PW00LM92/hardware.nix b/configurations/nixos/CORE-PW00LM92/hardware.nix similarity index 100% rename from systems/x86_64-linux/CORE-PW00LM92/hardware.nix rename to configurations/nixos/CORE-PW00LM92/hardware.nix diff --git a/systems/x86_64-linux/bruddynix/default.nix b/configurations/nixos/bruddynix/default.nix similarity index 92% rename from systems/x86_64-linux/bruddynix/default.nix rename to configurations/nixos/bruddynix/default.nix index fbee9ef61..217acde67 100644 --- a/systems/x86_64-linux/bruddynix/default.nix +++ b/configurations/nixos/bruddynix/default.nix @@ -1,11 +1,10 @@ { config, - lib, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) enabled; + inherit (khanelinix-lib) enabled; in { imports = [ @@ -80,7 +79,7 @@ in # TODO: make part of ssh config proper extraConfig = '' Host server - User ${config.${namespace}.user.name} + User ${config.khanelinix.user.name} Hostname austinserver.local ''; }; @@ -92,7 +91,7 @@ in # sops = { # enable = true; # sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; - # defaultSopsFile = lib.snowfall.fs.get-file "secrets/bruddynix/default.yaml"; + # defaultSopsFile = root + "secrets/bruddynix/default.yaml"; # }; }; @@ -125,6 +124,10 @@ in NO_POINTER_VIEWPORT = "1"; }; + nixpkgs.hostPlatform = { + system = "x86_64-linux"; + }; + nix.settings = { cores = 8; max-jobs = 8; diff --git a/systems/x86_64-linux/bruddynix/disks.nix b/configurations/nixos/bruddynix/disks.nix similarity index 91% rename from systems/x86_64-linux/bruddynix/disks.nix rename to configurations/nixos/bruddynix/disks.nix index 97cd13365..676a18dbb 100644 --- a/systems/x86_64-linux/bruddynix/disks.nix +++ b/configurations/nixos/bruddynix/disks.nix @@ -1,4 +1,7 @@ +{ lib, inputs, ... }: { + imports = lib.optional (inputs.disko ? nixosModules) inputs.disko.nixosModules.disko; + disko.devices.disk = { main = { device = "/dev/nvme0n1"; diff --git a/systems/x86_64-linux/bruddynix/hardware.nix b/configurations/nixos/bruddynix/hardware.nix similarity index 100% rename from systems/x86_64-linux/bruddynix/hardware.nix rename to configurations/nixos/bruddynix/hardware.nix diff --git a/systems/x86_64-linux/bruddynix/network.nix b/configurations/nixos/bruddynix/network.nix similarity index 100% rename from systems/x86_64-linux/bruddynix/network.nix rename to configurations/nixos/bruddynix/network.nix diff --git a/systems/x86_64-linux/bruddynix/specializations.nix b/configurations/nixos/bruddynix/specializations.nix similarity index 100% rename from systems/x86_64-linux/bruddynix/specializations.nix rename to configurations/nixos/bruddynix/specializations.nix diff --git a/systems/x86_64-linux/khanelilab/default.nix b/configurations/nixos/khanelilab/default.nix similarity index 85% rename from systems/x86_64-linux/khanelilab/default.nix rename to configurations/nixos/khanelilab/default.nix index c8ebb06d3..c8dde9f24 100644 --- a/systems/x86_64-linux/khanelilab/default.nix +++ b/configurations/nixos/khanelilab/default.nix @@ -1,11 +1,11 @@ { config, - lib, - namespace, + root, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) enabled; + inherit (khanelinix-lib) enabled; in { imports = [ @@ -119,7 +119,7 @@ in sops = { enable = true; sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; - defaultSopsFile = lib.snowfall.fs.get-file "secrets/khanelilab/default.yaml"; + defaultSopsFile = root + "/secrets/khanelilab/default.yaml"; }; }; @@ -151,11 +151,9 @@ in ]; }; - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + nixpkgs.hostPlatform = { + system = "x86_64-linux"; + }; + system.stateVersion = "21.11"; # Did you read the comment? } diff --git a/systems/x86_64-linux/khanelilab/disks.nix b/configurations/nixos/khanelilab/disks.nix similarity index 95% rename from systems/x86_64-linux/khanelilab/disks.nix rename to configurations/nixos/khanelilab/disks.nix index a34b6f253..aeb4b7714 100644 --- a/systems/x86_64-linux/khanelilab/disks.nix +++ b/configurations/nixos/khanelilab/disks.nix @@ -1,4 +1,7 @@ { + inputs, + lib, + disks ? [ "/dev/nvme0n1" "/dev/nvme1n1" @@ -7,6 +10,8 @@ ... }: { + imports = lib.optional (inputs.disko ? nixosModules) inputs.disko.nixosModules.disko; + disko.devices = { disk = { nvme0 = { diff --git a/systems/x86_64-linux/khanelilab/hardware.nix b/configurations/nixos/khanelilab/hardware.nix similarity index 100% rename from systems/x86_64-linux/khanelilab/hardware.nix rename to configurations/nixos/khanelilab/hardware.nix diff --git a/systems/x86_64-linux/khanelinix/default.nix b/configurations/nixos/khanelinix/default.nix similarity index 87% rename from systems/x86_64-linux/khanelinix/default.nix rename to configurations/nixos/khanelinix/default.nix index 553f18700..1d4e1b543 100644 --- a/systems/x86_64-linux/khanelinix/default.nix +++ b/configurations/nixos/khanelinix/default.nix @@ -1,11 +1,10 @@ { config, - lib, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) enabled; + inherit (khanelinix-lib) enabled; in { imports = [ @@ -138,7 +137,7 @@ in # TODO: make part of ssh config proper extraConfig = '' Host server - User ${config.${namespace}.user.name} + User ${config.khanelinix.user.name} Hostname austinserver.local ''; }; @@ -151,7 +150,7 @@ in browseable = true; comment = "Home Public folder"; only-owner-editable = false; - path = "/home/${config.${namespace}.user.name}/Public/"; + path = "/home/${config.khanelinix.user.name}/Public/"; public = true; read-only = false; }; @@ -175,7 +174,7 @@ in sops = { enable = true; sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; - defaultSopsFile = lib.snowfall.fs.get-file "secrets/khanelinix/default.yaml"; + # defaultSopsFile = flake.inputs.self + "/secrets/khanelinix/default.yaml"; }; }; @@ -235,11 +234,9 @@ in rpcbind.enable = true; # needed for NFS }; - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + nixpkgs.hostPlatform = { + system = "x86_64-linux"; + }; + system.stateVersion = "21.11"; # Did you read the comment? } diff --git a/systems/x86_64-linux/khanelinix/disks.nix b/configurations/nixos/khanelinix/disks.nix similarity index 97% rename from systems/x86_64-linux/khanelinix/disks.nix rename to configurations/nixos/khanelinix/disks.nix index 5200d5463..5e0bfb1d2 100644 --- a/systems/x86_64-linux/khanelinix/disks.nix +++ b/configurations/nixos/khanelinix/disks.nix @@ -1,5 +1,8 @@ { config, + inputs, + lib, + disks ? [ "/dev/nvme0n1" "/dev/nvme1n1" @@ -17,6 +20,8 @@ let ]; in { + imports = lib.optional (inputs.disko ? nixosModules) inputs.disko.nixosModules.disko; + disko.devices = { disk = { nvme0 = { diff --git a/systems/x86_64-linux/khanelinix/hardware.nix b/configurations/nixos/khanelinix/hardware.nix similarity index 100% rename from systems/x86_64-linux/khanelinix/hardware.nix rename to configurations/nixos/khanelinix/hardware.nix diff --git a/systems/x86_64-linux/khanelinix/hyprlandOutput b/configurations/nixos/khanelinix/hyprlandOutput similarity index 100% rename from systems/x86_64-linux/khanelinix/hyprlandOutput rename to configurations/nixos/khanelinix/hyprlandOutput diff --git a/systems/x86_64-linux/khanelinix/monitors.xml b/configurations/nixos/khanelinix/monitors.xml similarity index 100% rename from systems/x86_64-linux/khanelinix/monitors.xml rename to configurations/nixos/khanelinix/monitors.xml diff --git a/systems/x86_64-linux/khanelinix/network.nix b/configurations/nixos/khanelinix/network.nix similarity index 100% rename from systems/x86_64-linux/khanelinix/network.nix rename to configurations/nixos/khanelinix/network.nix diff --git a/systems/x86_64-linux/khanelinix/specializations.nix b/configurations/nixos/khanelinix/specializations.nix similarity index 100% rename from systems/x86_64-linux/khanelinix/specializations.nix rename to configurations/nixos/khanelinix/specializations.nix diff --git a/systems/x86_64-linux/khanelinix/swayOutput b/configurations/nixos/khanelinix/swayOutput similarity index 100% rename from systems/x86_64-linux/khanelinix/swayOutput rename to configurations/nixos/khanelinix/swayOutput diff --git a/systems/x86_64-linux/nixos/default.nix b/configurations/nixos/nixos/default.nix similarity index 62% rename from systems/x86_64-linux/nixos/default.nix rename to configurations/nixos/nixos/default.nix index 30e0bd7df..e1ddeb41d 100644 --- a/systems/x86_64-linux/nixos/default.nix +++ b/configurations/nixos/nixos/default.nix @@ -1,6 +1,6 @@ -{ lib, namespace, ... }: +{ khanelinix-lib, ... }: let - inherit (lib.${namespace}) enabled; + inherit (khanelinix-lib) enabled; in { imports = [ ./hardware.nix ]; @@ -51,11 +51,10 @@ in }; services.displayManager.defaultSession = "hyprland"; - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + + nixpkgs.hostPlatform = { + system = "x86_64-linux"; + }; + system.stateVersion = "21.11"; # Did you read the comment? } diff --git a/systems/x86_64-linux/nixos/hardware.nix b/configurations/nixos/nixos/hardware.nix similarity index 100% rename from systems/x86_64-linux/nixos/hardware.nix rename to configurations/nixos/nixos/hardware.nix diff --git a/flake.lock b/flake.lock index 319024a9f..442ba7ffc 100644 --- a/flake.lock +++ b/flake.lock @@ -75,8 +75,8 @@ "blink-cmp": { "inputs": { "fenix": "fenix", - "flake-parts": "flake-parts_3", - "nixpkgs": "nixpkgs_12" + "flake-parts": "flake-parts_5", + "nixpkgs": "nixpkgs_13" }, "locked": { "lastModified": 1737392822, @@ -215,27 +215,6 @@ "type": "github" } }, - "darwin": { - "inputs": { - "nixpkgs": [ - "nixpkgs-unstable" - ] - }, - "locked": { - "lastModified": 1737145639, - "narHash": "sha256-exe0Y2KQMa1uLg/ulOdFW53F5nYGMX2OSF4J3mikZzI=", - "owner": "khaneliman", - "repo": "nix-darwin", - "rev": "863b48be4d8f8ed36426f3a1ae4fede94243828e", - "type": "github" - }, - "original": { - "owner": "khaneliman", - "ref": "cherry-picks", - "repo": "nix-darwin", - "type": "github" - } - }, "deploy-rs": { "inputs": { "flake-compat": "flake-compat", @@ -297,6 +276,25 @@ "type": "github" } }, + "ez-configs": { + "inputs": { + "flake-parts": "flake-parts_3", + "nixpkgs": "nixpkgs_7" + }, + "locked": { + "lastModified": 1737481314, + "narHash": "sha256-z9IfbGyKfrinOwDMEf4tffC2rLPNuzQZzB8WQ6o5Z9o=", + "owner": "ehllie", + "repo": "ez-configs", + "rev": "b92cd0f807613afe2ebdcdd777edadbd839dde4e", + "type": "github" + }, + "original": { + "owner": "ehllie", + "repo": "ez-configs", + "type": "github" + } + }, "fenix": { "inputs": { "nixpkgs": [ @@ -385,6 +383,22 @@ } }, "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_5": { "locked": { "lastModified": 1696426674, "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", @@ -398,7 +412,7 @@ "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" } }, - "flake-compat_5": { + "flake-compat_6": { "flake": false, "locked": { "lastModified": 1696426674, @@ -414,7 +428,7 @@ "type": "github" } }, - "flake-compat_6": { + "flake-compat_7": { "flake": false, "locked": { "lastModified": 1733328505, @@ -430,7 +444,7 @@ "type": "github" } }, - "flake-compat_7": { + "flake-compat_8": { "flake": false, "locked": { "lastModified": 1696426674, @@ -447,22 +461,6 @@ "type": "github" } }, - "flake-compat_8": { - "flake": false, - "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-compat_9": { "flake": false, "locked": { @@ -519,9 +517,48 @@ } }, "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "ez-configs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1698882062, + "narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8c9fa2545007b49a5db5f650ae91f227672c3877", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_4": { "inputs": { "nixpkgs-lib": "nixpkgs-lib_2" }, + "locked": { + "lastModified": 1736143030, + "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_5": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_3" + }, "locked": { "lastModified": 1733312601, "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", @@ -536,9 +573,9 @@ "type": "github" } }, - "flake-parts_4": { + "flake-parts_6": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib_3" + "nixpkgs-lib": "nixpkgs-lib_4" }, "locked": { "lastModified": 1736143030, @@ -554,7 +591,7 @@ "type": "github" } }, - "flake-parts_5": { + "flake-parts_7": { "inputs": { "nixpkgs-lib": [ "khanelivim", @@ -576,7 +613,7 @@ "type": "github" } }, - "flake-parts_6": { + "flake-parts_8": { "inputs": { "nixpkgs-lib": [ "lanzaboote", @@ -597,7 +634,7 @@ "type": "github" } }, - "flake-parts_7": { + "flake-parts_9": { "inputs": { "nixpkgs-lib": [ "nur", @@ -655,25 +692,6 @@ "type": "github" } }, - "flake-utils-plus_2": { - "inputs": { - "flake-utils": "flake-utils_6" - }, - "locked": { - "lastModified": 1715533576, - "narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=", - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", - "type": "github" - }, - "original": { - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", - "type": "github" - } - }, "flake-utils_2": { "inputs": { "systems": "systems_4" @@ -747,24 +765,6 @@ "inputs": { "systems": "systems_8" }, - "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_7": { - "inputs": { - "systems": "systems_9" - }, "locked": { "lastModified": 1731533236, "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", @@ -803,7 +803,7 @@ "nixvim", "flake-compat" ], - "gitignore": "gitignore_3", + "gitignore": "gitignore_4", "nixpkgs": [ "khanelivim", "nixvim", @@ -828,7 +828,27 @@ "inputs": { "flake-compat": "flake-compat_2", "gitignore": "gitignore", - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_8" + }, + "locked": { + "lastModified": 1737465171, + "narHash": "sha256-R10v2hoJRLq8jcL4syVFag7nIGE7m13qO48wRIukWNg=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "git-hooks-nix_2": { + "inputs": { + "flake-compat": "flake-compat_4", + "gitignore": "gitignore_3", + "nixpkgs": "nixpkgs_14" }, "locked": { "lastModified": 1737465171, @@ -888,6 +908,28 @@ } }, "gitignore_3": { + "inputs": { + "nixpkgs": [ + "khanelivim", + "git-hooks-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_4": { "inputs": { "nixpkgs": [ "khanelivim", @@ -910,7 +952,7 @@ "type": "github" } }, - "gitignore_4": { + "gitignore_5": { "inputs": { "nixpkgs": [ "lanzaboote", @@ -994,7 +1036,7 @@ }, "home-manager_2": { "inputs": { - "nixpkgs": "nixpkgs_8" + "nixpkgs": "nixpkgs_9" }, "locked": { "lastModified": 1737480538, @@ -1055,7 +1097,7 @@ }, "hypr-socket-watch": { "inputs": { - "nixpkgs": "nixpkgs_9", + "nixpkgs": "nixpkgs_10", "rust-overlay": "rust-overlay" }, "locked": { @@ -1140,7 +1182,7 @@ "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs_11", + "nixpkgs": "nixpkgs_12", "pre-commit-hooks": "pre-commit-hooks", "systems": "systems_5", "xdph": "xdph" @@ -1385,13 +1427,11 @@ "blink-cmp": "blink-cmp", "blink-compat": "blink-compat", "blink-emoji": "blink-emoji", - "flake-parts": "flake-parts_4", - "git-hooks-nix": [ - "git-hooks-nix" - ], + "flake-parts": "flake-parts_6", + "git-hooks-nix": "git-hooks-nix_2", "home-manager": "home-manager_3", "nix-darwin": "nix-darwin", - "nixpkgs": "nixpkgs_13", + "nixpkgs": "nixpkgs_15", "nixpkgs-master": "nixpkgs-master", "nixvim": "nixvim", "pkgs-by-name-for-flake-parts": "pkgs-by-name-for-flake-parts", @@ -1414,10 +1454,10 @@ "lanzaboote": { "inputs": { "crane": "crane", - "flake-compat": "flake-compat_5", - "flake-parts": "flake-parts_6", + "flake-compat": "flake-compat_6", + "flake-parts": "flake-parts_8", "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_16", + "nixpkgs": "nixpkgs_18", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "rust-overlay": "rust-overlay_2" }, @@ -1496,6 +1536,27 @@ "type": "github" } }, + "nix-darwin_3": { + "inputs": { + "nixpkgs": [ + "nixpkgs-unstable" + ] + }, + "locked": { + "lastModified": 1737145639, + "narHash": "sha256-exe0Y2KQMa1uLg/ulOdFW53F5nYGMX2OSF4J3mikZzI=", + "owner": "khaneliman", + "repo": "nix-darwin", + "rev": "863b48be4d8f8ed36426f3a1ae4fede94243828e", + "type": "github" + }, + "original": { + "owner": "khaneliman", + "ref": "cherry-picks", + "repo": "nix-darwin", + "type": "github" + } + }, "nix-flatpak": { "locked": { "lastModified": 1734128415, @@ -1514,7 +1575,7 @@ }, "nix-index-database": { "inputs": { - "nixpkgs": "nixpkgs_17" + "nixpkgs": "nixpkgs_19" }, "locked": { "lastModified": 1737257306, @@ -1532,7 +1593,7 @@ }, "nixos-wsl": { "inputs": { - "flake-compat": "flake-compat_6", + "flake-compat": "flake-compat_7", "nixpkgs": [ "nixpkgs" ] @@ -1586,6 +1647,18 @@ } }, "nixpkgs-lib_2": { + "locked": { + "lastModified": 1735774519, + "narHash": "sha256-CewEm1o2eVAnoqb6Ml+Qi9Gg/EfNAxbRx1lANGVyoLI=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz" + } + }, + "nixpkgs-lib_3": { "locked": { "lastModified": 1733096140, "narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=", @@ -1597,7 +1670,7 @@ "url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz" } }, - "nixpkgs-lib_3": { + "nixpkgs-lib_4": { "locked": { "lastModified": 1735774519, "narHash": "sha256-CewEm1o2eVAnoqb6Ml+Qi9Gg/EfNAxbRx1lANGVyoLI=", @@ -1626,11 +1699,11 @@ }, "nixpkgs-master_2": { "locked": { - "lastModified": 1737489528, - "narHash": "sha256-4MX/hEaYbYNEhjRnPtRO0hTAcEH3aojQn+Y7mZLn8p4=", + "lastModified": 1737516916, + "narHash": "sha256-wqTZaz5q766YWaUafGauYKrb++aH0EYZWvt0KmrIvqg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "cdf3f06ff6d90824b57287814b709d6f2b276fef", + "rev": "a7cce252dae969644ee9ef681ce309f8fad6cee6", "type": "github" }, "original": { @@ -1688,6 +1761,22 @@ } }, "nixpkgs_10": { + "locked": { + "lastModified": 1714253743, + "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_11": { "locked": { "lastModified": 1706487304, "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", @@ -1703,7 +1792,7 @@ "type": "github" } }, - "nixpkgs_11": { + "nixpkgs_12": { "locked": { "lastModified": 1737062831, "narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=", @@ -1719,7 +1808,7 @@ "type": "github" } }, - "nixpkgs_12": { + "nixpkgs_13": { "locked": { "lastModified": 1736166416, "narHash": "sha256-U47xeACNBpkSO6IcCm0XvahsVXpJXzjPIQG7TZlOToU=", @@ -1735,7 +1824,23 @@ "type": "github" } }, - "nixpkgs_13": { + "nixpkgs_14": { + "locked": { + "lastModified": 1730768919, + "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_15": { "locked": { "lastModified": 1737370608, "narHash": "sha256-hFA6SmioeqvGW/XvZa9bxniAeulksCOcj3kokdNT/YE=", @@ -1751,7 +1856,7 @@ "type": "github" } }, - "nixpkgs_14": { + "nixpkgs_16": { "locked": { "lastModified": 1736883708, "narHash": "sha256-uQ+NQ0/xYU0N1CnXsa2zghgNaOPxWpMJXSUJJ9W7140=", @@ -1767,7 +1872,7 @@ "type": "github" } }, - "nixpkgs_15": { + "nixpkgs_17": { "locked": { "lastModified": 1735554305, "narHash": "sha256-zExSA1i/b+1NMRhGGLtNfFGXgLtgo+dcuzHzaWA6w3Q=", @@ -1783,7 +1888,7 @@ "type": "github" } }, - "nixpkgs_16": { + "nixpkgs_18": { "locked": { "lastModified": 1717794163, "narHash": "sha256-Ch6ZpFPVvi7Bb6gmmuufpTEFkXqa43pC94XMfU5FEt0=", @@ -1799,7 +1904,7 @@ "type": "github" } }, - "nixpkgs_17": { + "nixpkgs_19": { "locked": { "lastModified": 1737062831, "narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=", @@ -1815,13 +1920,26 @@ "type": "github" } }, - "nixpkgs_18": { + "nixpkgs_2": { "locked": { - "lastModified": 1737062831, - "narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=", + "lastModified": 1690031011, + "narHash": "sha256-kzK0P4Smt7CL53YCdZCBbt9uBFFhE0iNvCki20etAf4=", + "path": "/nix/store/gxw5rlp29swdpgz26vhaqzy21b9pxrim-source", + "rev": "12303c652b881435065a98729eb7278313041e49", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_20": { + "locked": { + "lastModified": 1737469691, + "narHash": "sha256-nmKOgAU48S41dTPIXAq0AHZSehWUn6ZPrUKijHAMmIk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5df43628fdf08d642be8ba5b3625a6c70731c19c", + "rev": "9e4d5190a9482a1fb9d18adf0bdb83c6e506eaab", "type": "github" }, "original": { @@ -1831,7 +1949,7 @@ "type": "github" } }, - "nixpkgs_19": { + "nixpkgs_21": { "locked": { "lastModified": 1737469691, "narHash": "sha256-nmKOgAU48S41dTPIXAq0AHZSehWUn6ZPrUKijHAMmIk=", @@ -1847,20 +1965,7 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1690031011, - "narHash": "sha256-kzK0P4Smt7CL53YCdZCBbt9uBFFhE0iNvCki20etAf4=", - "path": "/nix/store/gxw5rlp29swdpgz26vhaqzy21b9pxrim-source", - "rev": "12303c652b881435065a98729eb7278313041e49", - "type": "path" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_20": { + "nixpkgs_22": { "locked": { "lastModified": 1704290814, "narHash": "sha256-LWvKHp7kGxk/GEtlrGYV68qIvPHkU9iToomNFGagixU=", @@ -1876,7 +1981,7 @@ "type": "github" } }, - "nixpkgs_21": { + "nixpkgs_23": { "locked": { "lastModified": 1731763621, "narHash": "sha256-ddcX4lQL0X05AYkrkV2LMFgGdRvgap7Ho8kgon3iWZk=", @@ -1892,7 +1997,7 @@ "type": "github" } }, - "nixpkgs_22": { + "nixpkgs_24": { "locked": { "lastModified": 1735554305, "narHash": "sha256-zExSA1i/b+1NMRhGGLtNfFGXgLtgo+dcuzHzaWA6w3Q=", @@ -1908,7 +2013,7 @@ "type": "github" } }, - "nixpkgs_23": { + "nixpkgs_25": { "locked": { "lastModified": 1735471104, "narHash": "sha256-0q9NGQySwDQc7RhAV2ukfnu7Gxa5/ybJ2ANT8DQrQrs=", @@ -1924,7 +2029,7 @@ "type": "github" } }, - "nixpkgs_24": { + "nixpkgs_26": { "locked": { "lastModified": 1735821806, "narHash": "sha256-cuNapx/uQeCgeuhUhdck3JKbgpsml259sjUQnWM7zW8=", @@ -2005,43 +2110,43 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1730768919, - "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", + "lastModified": 1699963925, + "narHash": "sha256-LE7OV/SwkIBsCpAlIPiFhch/J+jBDGEZjNfdnzCnCrY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", + "rev": "bf744fe90419885eefced41b3e5ae442d732712d", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_8": { "locked": { - "lastModified": 1736012469, - "narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", + "lastModified": 1730768919, + "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", + "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_9": { "locked": { - "lastModified": 1714253743, - "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", + "lastModified": 1736012469, + "narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", + "rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", "type": "github" }, "original": { @@ -2054,12 +2159,12 @@ "nixvim": { "inputs": { "devshell": "devshell", - "flake-compat": "flake-compat_4", - "flake-parts": "flake-parts_5", + "flake-compat": "flake-compat_5", + "flake-parts": "flake-parts_7", "git-hooks": "git-hooks", "home-manager": "home-manager_4", "nix-darwin": "nix-darwin_2", - "nixpkgs": "nixpkgs_14", + "nixpkgs": "nixpkgs_16", "nuschtosSearch": "nuschtosSearch", "treefmt-nix": "treefmt-nix" }, @@ -2079,16 +2184,16 @@ }, "nur": { "inputs": { - "flake-parts": "flake-parts_7", - "nixpkgs": "nixpkgs_19", + "flake-parts": "flake-parts_9", + "nixpkgs": "nixpkgs_21", "treefmt-nix": "treefmt-nix_3" }, "locked": { - "lastModified": 1737516724, - "narHash": "sha256-Gb3JqIgmMpMW9S7rAuvu31U2tt29mTXemToNNzVlykE=", + "lastModified": 1737518681, + "narHash": "sha256-pJir14+pO9YGDYsPydiaSxg63PmCWtaaem9jPd/WcOA=", "owner": "nix-community", "repo": "NUR", - "rev": "ab730f4eabe4668f857164c620a390e586309b5e", + "rev": "5b373298909d7c7a349cc02deffd0e86b1b51053", "type": "github" }, "original": { @@ -2159,6 +2264,21 @@ "type": "github" } }, + "pkgs-by-name-for-flake-parts_2": { + "locked": { + "lastModified": 1727519927, + "narHash": "sha256-3SNX6BuaisoX9PKYI+fh3geZ3jBgKKkAtHcWuHRU0+o=", + "owner": "drupol", + "repo": "pkgs-by-name-for-flake-parts", + "rev": "91debb07d81ff25b8e3b48914b6abd6f11dc26e2", + "type": "github" + }, + "original": { + "owner": "drupol", + "repo": "pkgs-by-name-for-flake-parts", + "type": "github" + } + }, "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat_3", @@ -2188,7 +2308,7 @@ "lanzaboote", "flake-compat" ], - "gitignore": "gitignore_4", + "gitignore": "gitignore_5", "nixpkgs": [ "lanzaboote", "nixpkgs" @@ -2215,24 +2335,26 @@ "anyrun-nixos-options": "anyrun-nixos-options", "catppuccin": "catppuccin", "catppuccin-cursors": "catppuccin-cursors", - "darwin": "darwin", "deploy-rs": "deploy-rs", "disko": "disko", + "ez-configs": "ez-configs", + "flake-parts": "flake-parts_4", "git-hooks-nix": "git-hooks-nix", "home-manager": "home-manager_2", "hypr-socket-watch": "hypr-socket-watch", "hyprland": "hyprland", "khanelivim": "khanelivim", "lanzaboote": "lanzaboote", + "nix-darwin": "nix-darwin_3", "nix-flatpak": "nix-flatpak", "nix-index-database": "nix-index-database", "nixos-wsl": "nixos-wsl", - "nixpkgs": "nixpkgs_18", + "nixpkgs": "nixpkgs_20", "nixpkgs-master": "nixpkgs-master_2", "nixpkgs-unstable": "nixpkgs-unstable", "nur": "nur", + "pkgs-by-name-for-flake-parts": "pkgs-by-name-for-flake-parts_2", "snowfall-flake": "snowfall-flake", - "snowfall-lib": "snowfall-lib_2", "sops-nix": "sops-nix", "treefmt-nix": "treefmt-nix_4", "waybar": "waybar", @@ -2260,7 +2382,7 @@ "rust-overlay": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_10" + "nixpkgs": "nixpkgs_11" }, "locked": { "lastModified": 1714529851, @@ -2324,8 +2446,8 @@ }, "snowfall-flake": { "inputs": { - "flake-compat": "flake-compat_7", - "nixpkgs": "nixpkgs_20", + "flake-compat": "flake-compat_8", + "nixpkgs": "nixpkgs_22", "snowfall-lib": "snowfall-lib" }, "locked": { @@ -2344,7 +2466,7 @@ }, "snowfall-lib": { "inputs": { - "flake-compat": "flake-compat_8", + "flake-compat": "flake-compat_9", "flake-utils-plus": "flake-utils-plus", "nixpkgs": [ "snowfall-flake", @@ -2366,31 +2488,9 @@ "type": "github" } }, - "snowfall-lib_2": { - "inputs": { - "flake-compat": "flake-compat_9", - "flake-utils-plus": "flake-utils-plus_2", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1736130495, - "narHash": "sha256-4i9nAJEZFv7vZMmrE0YG55I3Ggrtfo5/T07JEpEZ/RM=", - "owner": "snowfallorg", - "repo": "lib", - "rev": "02d941739f98a09e81f3d2d9b3ab08918958beac", - "type": "github" - }, - "original": { - "owner": "snowfallorg", - "repo": "lib", - "type": "github" - } - }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_21" + "nixpkgs": "nixpkgs_23" }, "locked": { "lastModified": 1737411508, @@ -2526,21 +2626,6 @@ "type": "github" } }, - "systems_9": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -2565,7 +2650,7 @@ }, "treefmt-nix_2": { "inputs": { - "nixpkgs": "nixpkgs_15" + "nixpkgs": "nixpkgs_17" }, "locked": { "lastModified": 1737483750, @@ -2604,7 +2689,7 @@ }, "treefmt-nix_4": { "inputs": { - "nixpkgs": "nixpkgs_22" + "nixpkgs": "nixpkgs_24" }, "locked": { "lastModified": 1737483750, @@ -2641,7 +2726,7 @@ "waybar": { "inputs": { "flake-compat": "flake-compat_10", - "nixpkgs": "nixpkgs_23" + "nixpkgs": "nixpkgs_25" }, "locked": { "lastModified": 1736677965, @@ -2659,11 +2744,11 @@ }, "wezterm": { "inputs": { - "flake-utils": "flake-utils_7", + "flake-utils": "flake-utils_6", "freetype2": "freetype2", "harfbuzz": "harfbuzz", "libpng": "libpng", - "nixpkgs": "nixpkgs_24", + "nixpkgs": "nixpkgs_26", "rust-overlay": "rust-overlay_3", "zlib": "zlib" }, diff --git a/flake.nix b/flake.nix index 406da2d9b..715f6769f 100644 --- a/flake.nix +++ b/flake.nix @@ -2,84 +2,54 @@ description = "KhaneliNix"; inputs = { - - # ╭──────────────────────────────────────────────────────────╮ - # │ Core System │ - # ╰──────────────────────────────────────────────────────────╯ - darwin = { + # Core Inputs + ez-configs.url = "github:ehllie/ez-configs"; + flake-parts.url = "github:hercules-ci/flake-parts"; + home-manager.url = "github:nix-community/home-manager"; + # home-manager.url = "git+file:///home/khaneliman/Documents/github/home-manager"; + # home-manager.url = "git+file:///Users/khaneliman/Documents/github/home-manager"; + lanzaboote.url = "github:nix-community/lanzaboote/v0.4.1"; # Secure boot + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs-master.url = "github:nixos/nixpkgs"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + pkgs-by-name-for-flake-parts.url = "github:drupol/pkgs-by-name-for-flake-parts"; + nix-darwin = { # url = "github:lnl7/nix-darwin"; # NOTE: Upstream slow to respond to PRs, using own fork. url = "github:khaneliman/nix-darwin/cherry-picks"; # url = "git+file:///Users/khaneliman/github/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs-unstable"; }; - - git-hooks-nix.url = "github:cachix/git-hooks.nix"; - - home-manager.url = "github:nix-community/home-manager"; - # home-manager.url = "github:khaneliman/home-manager/thunderbird"; - # home-manager.url = "git+file:///home/khaneliman/Documents/github/home-manager"; - # home-manager.url = "git+file:///Users/khaneliman/Documents/github/home-manager"; - - # Secure boot - lanzaboote.url = "github:nix-community/lanzaboote/v0.4.1"; - - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - nixpkgs-master.url = "github:nixos/nixpkgs"; - nixos-wsl = { url = "github:nix-community/nixos-wsl"; inputs.nixpkgs.follows = "nixpkgs"; }; + sops-nix.url = "github:Mic92/sops-nix"; # Secrets management - snowfall-lib = { - url = "github:snowfallorg/lib"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - # Secrets management - sops-nix = { - url = "github:Mic92/sops-nix"; - }; - + # Dev Inputs + git-hooks-nix.url = "github:cachix/git-hooks.nix"; treefmt-nix.url = "github:numtide/treefmt-nix"; - # ╭──────────────────────────────────────────────────────────╮ - # │ System Deployment │ - # ╰──────────────────────────────────────────────────────────╯ + # System Deployment deploy-rs.url = "github:serokell/deploy-rs"; disko.url = "github:nix-community/disko/latest"; - # ╭──────────────────────────────────────────────────────────╮ - # │ Applications │ - # ╰──────────────────────────────────────────────────────────╯ + # Applications anyrun.url = "github:anyrun-org/anyrun"; anyrun-nixos-options.url = "github:n3oney/anyrun-nixos-options"; - catppuccin-cursors.url = "github:catppuccin/cursors"; catppuccin.url = "github:catppuccin/nix"; - hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; hypr-socket-watch.url = "github:khaneliman/hypr-socket-watch"; - - khanelivim = { - url = "github:khaneliman/khanelivim"; - # url = "git+file:///Users/khaneliman/Documents/github/khanelivim"; - # url = "git+file:///home/khaneliman/Documents/github/khanelivim"; - inputs = { - # nixpkgs.follows = "nixpkgs"; - git-hooks-nix.follows = "git-hooks-nix"; - }; - }; - + khanelivim.url = "github:khaneliman/khanelivim"; + # khanelivim.url = "git+file:///Users/khaneliman/Documents/github/khanelivim"; + # khanelivim.url = "git+file:///home/khaneliman/Documents/github/khanelivim"; nix-flatpak.url = "github:gmodena/nix-flatpak/latest"; nix-index-database.url = "github:nix-community/nix-index-database"; nur.url = "github:nix-community/NUR"; snowfall-flake.url = "github:snowfallorg/flake"; waybar.url = "github:Alexays/Waybar"; wezterm.url = "github:wez/wezterm?dir=nix"; - yazi-plugins = { url = "github:yazi-rs/plugins"; flake = false; @@ -87,98 +57,18 @@ }; outputs = - inputs: - let - inherit (inputs) snowfall-lib; - - lib = snowfall-lib.mkLib { - inherit inputs; - src = ./.; - - snowfall = { - meta = { - name = "khanelinix"; - title = "KhaneliNix"; - }; - - namespace = "khanelinix"; - }; - }; - in - lib.mkFlake { - channels-config = { - # allowBroken = true; - allowUnfree = true; - # showDerivationWarnings = [ "maintainerless" ]; - - # TODO: cleanup when available - permittedInsecurePackages = [ - # NOTE: needed by emulationstation - "freeimage-unstable-2021-11-01" - # dev shells - "aspnetcore-runtime-6.0.36" - "aspnetcore-runtime-7.0.20" - "aspnetcore-runtime-wrapped-7.0.20" - "aspnetcore-runtime-wrapped-6.0.36" - "dotnet-combined" - "dotnet-core-combined" - "dotnet-runtime-6.0.36" - "dotnet-runtime-7.0.20" - "dotnet-runtime-wrapped-6.0.36" - "dotnet-runtime-wrapped-7.0.20" - "dotnet-sdk-6.0.428" - "dotnet-sdk-7.0.410" - "dotnet-sdk-wrapped-6.0.428" - "dotnet-sdk-wrapped-7.0.410" - "dotnet-wrapped-combined" - ]; - }; - - overlays = [ ]; - - homes.modules = with inputs; [ - anyrun.homeManagerModules.default - catppuccin.homeManagerModules.catppuccin - hypr-socket-watch.homeManagerModules.default - nix-index-database.hmModules.nix-index - # FIXME: - # nur.modules.homeManager.default - sops-nix.homeManagerModules.sops + { + flake-parts, + ... + }@inputs: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ + "x86_64-linux" + "aarch64-darwin" ]; - systems = { - modules = { - darwin = with inputs; [ - sops-nix.darwinModules.sops - ]; - nixos = with inputs; [ - disko.nixosModules.disko - lanzaboote.nixosModules.lanzaboote - nix-flatpak.nixosModules.nix-flatpak - sops-nix.nixosModules.sops - ]; - }; - }; - - templates = { - angular.description = "Angular template"; - c.description = "C flake template."; - container.description = "Container template"; - cpp.description = "CPP flake template"; - dotnetf.description = "Dotnet FSharp template"; - flake-compat.description = "Flake-compat shell and default files."; - go.description = "Go template"; - node.description = "Node template"; - python.description = "Python template"; - rust.description = "Rust template"; - rust-web-server.description = "Rust web server template"; - snowfall.description = "Snowfall-lib template"; - }; - - deploy = lib.mkDeploy { inherit (inputs) self; }; - - outputs-builder = channels: { - formatter = inputs.treefmt-nix.lib.mkWrapper channels.nixpkgs ./treefmt.nix; - }; + imports = [ + ./flake + ]; }; } diff --git a/flake/configs.nix b/flake/configs.nix new file mode 100644 index 000000000..e589e6f11 --- /dev/null +++ b/flake/configs.nix @@ -0,0 +1,38 @@ +{ + inputs, + lib, + self, + ... +}: +{ + imports = lib.optional (inputs.ez-configs ? flakeModule) inputs.ez-configs.flakeModule; + + ezConfigs = { + root = ../.; + + earlyModuleArgs = { + namespace = "khanelinix"; + }; + + globalArgs = { + inherit inputs self; + khanelinix-lib = self.lib.khanelinix; + root = ../.; + }; + + darwin = { + configurationsDirectory = ../configurations/darwin; + modulesDirectory = ../modules/darwin; + }; + + home = { + configurationsDirectory = ../configurations/home; + modulesDirectory = ../modules/home; + }; + + nixos = { + configurationsDirectory = ../configurations/nixos; + modulesDirectory = ../modules/nixos; + }; + }; +} diff --git a/flake/default.nix b/flake/default.nix new file mode 100644 index 000000000..fc7dbd066 --- /dev/null +++ b/flake/default.nix @@ -0,0 +1,32 @@ +{ + inputs, + lib, + self, + ... +}: +{ + imports = [ + ./configs.nix + ./devshell.nix + ./git-hooks.nix + ./lib.nix + ./overlays.nix + ./pkgs-by-name.nix + ./treefmt.nix + ]; + + perSystem = + { + system, + ... + }: + { + _module.args.pkgs = import inputs.nixpkgs { + inherit system; + overlays = lib.attrValues self.overlays; + config.allowUnfree = true; + }; + + _module.args.root = ../.; + }; +} diff --git a/flake/devshell.nix b/flake/devshell.nix new file mode 100644 index 000000000..137c46291 --- /dev/null +++ b/flake/devshell.nix @@ -0,0 +1,14 @@ +{ + perSystem = + { pkgs, ... }: + { + devShells.default = pkgs.mkShell { + name = "Khanelivim development shell"; + meta.description = "Shell environment for modifying this Nix configuration"; + packages = with pkgs; [ + just + nixd + ]; + }; + }; +} diff --git a/flake/git-hooks.nix b/flake/git-hooks.nix new file mode 100644 index 000000000..47527d691 --- /dev/null +++ b/flake/git-hooks.nix @@ -0,0 +1,40 @@ +{ lib, inputs, ... }: +{ + imports = lib.optional (inputs.git-hooks-nix ? flakeModule) inputs.git-hooks-nix.flakeModule; + + perSystem = + { + lib, + pkgs, + ... + }: + lib.optionalAttrs (inputs.git-hooks-nix ? flakeModule) { + pre-commit = { + check.enable = false; + + settings.hooks = { + actionlint.enable = true; + clang-tidy.enable = true; + deadnix = { + enable = true; + + settings = { + edit = true; + }; + }; + eslint = { + enable = true; + package = pkgs.eslint_d; + }; + luacheck.enable = true; + pre-commit-hook-ensure-sops.enable = true; + statix.enable = true; + treefmt.enable = true; + typos = { + enable = true; + excludes = [ "generated/*" ]; + }; + }; + }; + }; +} diff --git a/flake/lib.nix b/flake/lib.nix new file mode 100644 index 000000000..814cf0301 --- /dev/null +++ b/flake/lib.nix @@ -0,0 +1,14 @@ +{ lib, self, ... }: +{ + # Expose lib as a flake-parts module arg + _module.args = { + khanelinix-lib = self.lib.khanelinix; + }; + + # Create internal lib + flake.lib = { + khanelinix = lib.makeOverridable (import ../lib) { + inherit lib self; + }; + }; +} diff --git a/flake/overlays.nix b/flake/overlays.nix new file mode 100644 index 000000000..12bb249a4 --- /dev/null +++ b/flake/overlays.nix @@ -0,0 +1,19 @@ +{ inputs, lib, ... }: +let + children = + dir: + with builtins; + lib.pipe dir [ + readDir + attrNames + (map (name: dir + "/${name}")) + ]; +in +{ + flake.overlays = lib.listToAttrs ( + map (file: { + name = "${lib.removeSuffix ".nix" (builtins.hashString "sha256" (builtins.readFile file))}-overlay"; + value = import file { flake = inputs.self; }; + }) (children ../overlays) + ); +} diff --git a/flake/pkgs-by-name.nix b/flake/pkgs-by-name.nix new file mode 100644 index 000000000..a8384b971 --- /dev/null +++ b/flake/pkgs-by-name.nix @@ -0,0 +1,19 @@ +{ + inputs, + lib, + ... +}: +{ + imports = lib.optional ( + inputs.pkgs-by-name-for-flake-parts ? flakeModule + ) inputs.pkgs-by-name-for-flake-parts.flakeModule; + + perSystem = + { + lib, + ... + }: + lib.optionalAttrs (inputs.pkgs-by-name-for-flake-parts ? flakeModule) { + pkgsDirectory = ../packages; + }; +} diff --git a/flake/treefmt.nix b/flake/treefmt.nix new file mode 100644 index 000000000..55f8309cf --- /dev/null +++ b/flake/treefmt.nix @@ -0,0 +1,82 @@ +{ lib, inputs, ... }: +{ + imports = lib.optional (inputs.treefmt-nix ? flakeModule) inputs.treefmt-nix.flakeModule; + + perSystem = + { + lib, + ... + }: + lib.optionalAttrs (inputs.treefmt-nix ? flakeModule) { + treefmt = { + flakeCheck = true; + flakeFormatter = true; + + projectRootFile = "flake.nix"; + + programs = { + actionlint.enable = true; + biome = { + enable = true; + settings.formatter.formatWithErrors = true; + }; + clang-format.enable = true; + deadnix = { + enable = true; + }; + deno = { + enable = true; + # Using biome for these + excludes = [ + "*.ts" + "*.js" + "*.json" + "*.jsonc" + ]; + }; + fantomas.enable = true; + fish_indent.enable = true; + gofmt.enable = true; + isort.enable = true; + nixfmt.enable = true; + nufmt.enable = true; + ruff-check.enable = true; + ruff-format.enable = true; + rustfmt.enable = true; + shfmt = { + enable = true; + indent_size = 4; + }; + statix.enable = true; + stylua.enable = true; + taplo.enable = true; + yamlfmt.enable = true; + }; + + settings = { + global.excludes = [ + "*.editorconfig" + "*.envrc" + "*.gif" + "*.git-blame-ignore-revs" + "*.gitattributes" + "*.gitconfig" + "*.gitignore" + "*.kdl" + "*.luacheckrc" + "*.png" + "*.rasi" + "*.svg" + "*.zsh" + "*CODEOWNERS" + "*LICENSE" + "*flake.lock" + "assets/*" + "justfile" + ]; + + formatter.ruff-format.options = [ "--isolated" ]; + }; + }; + }; +} diff --git a/lib/default.nix b/lib/default.nix index c546ea9c4..9058b840d 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,7 +1,42 @@ -_: { - override-meta = - meta: package: - package.overrideAttrs (_: { - inherit meta; - }); -} +{ + lib, + self, + ... +}: +lib.makeExtensible ( + self': + let + call = lib.callPackageWith { + inherit call self' lib; + }; + in + { + audio = call ./audio/default.nix { }; + base64 = call ./base64/default.nix { }; + deploy = call ./deploy/default.nix { + inherit (self) inputs; + }; + file = call ./file/default.nix { }; + module = call ./module/default.nix { }; + packages = call ./packages/default.nix { }; + network = call ./network/default.nix { + inherit (self) inputs; + }; + theme = call ./theme/default.nix { }; + + inherit (self'.module) + mkOpt + mkOpt' + mkBoolOpt + mkBoolOpt' + enabled + disabled + capitalize + boolToNum + default-attrs + force-attrs + nested-default-attrs + nested-force-attrs + ; + } +) diff --git a/lib/deploy/default.nix b/lib/deploy/default.nix index d921bd16d..074cae47c 100644 --- a/lib/deploy/default.nix +++ b/lib/deploy/default.nix @@ -1,7 +1,7 @@ { lib, inputs, - namespace, + }: let inherit (inputs) deploy-rs; @@ -18,7 +18,7 @@ rec { ## } ## ``` ## - #@ { self: Flake, overrides: Attrs ? {} } -> Attrs + #@ { self: khanelinix-lib, overrides: Attrs ? {} } -> Attrs mkDeploy = { self, @@ -31,7 +31,7 @@ rec { result: name: let host = hosts.${name}; - user = host.config.${namespace}.user.name or null; + user = host.config.khanelinix.user.name or null; inherit (host.pkgs) system; in result @@ -48,7 +48,7 @@ rec { user = "root"; sshUser = user; }; - # // lib.optionalAttrs (host.config.${namespace}.security.doas.enable or false) { sudo = "doas -u"; }; + # // lib.optionalAttrs (host.config.khanelinix.security.doas.enable or false) { sudo = "doas -u"; }; }; }; } diff --git a/lib/packages/default.nix b/lib/packages/default.nix new file mode 100644 index 000000000..c546ea9c4 --- /dev/null +++ b/lib/packages/default.nix @@ -0,0 +1,7 @@ +_: { + override-meta = + meta: package: + package.overrideAttrs (_: { + inherit meta; + }); +} diff --git a/modules/darwin/archetypes/personal/default.nix b/modules/darwin/archetypes/personal/default.nix index c062d24c3..66b6e1c37 100644 --- a/modules/darwin/archetypes/personal/default.nix +++ b/modules/darwin/archetypes/personal/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.archetypes.personal; + cfg = config.khanelinix.archetypes.personal; in { - options.${namespace}.archetypes.personal = { + options.khanelinix.archetypes.personal = { enable = mkBoolOpt false "Whether or not to enable the personal archetype."; }; diff --git a/modules/darwin/archetypes/vm/default.nix b/modules/darwin/archetypes/vm/default.nix index 23ef5b529..03262f1a9 100644 --- a/modules/darwin/archetypes/vm/default.nix +++ b/modules/darwin/archetypes/vm/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.archetypes.vm; + cfg = config.khanelinix.archetypes.vm; in { - options.${namespace}.archetypes.vm = { + options.khanelinix.archetypes.vm = { enable = mkBoolOpt false "Whether or not to enable the vm archetype."; }; diff --git a/modules/darwin/archetypes/workstation/default.nix b/modules/darwin/archetypes/workstation/default.nix index 1e17016b3..8278486be 100644 --- a/modules/darwin/archetypes/workstation/default.nix +++ b/modules/darwin/archetypes/workstation/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.archetypes.workstation; + cfg = config.khanelinix.archetypes.workstation; in { - options.${namespace}.archetypes.workstation = { + options.khanelinix.archetypes.workstation = { enable = mkBoolOpt false "Whether or not to enable the workstation archetype."; }; diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix new file mode 100644 index 000000000..d20031888 --- /dev/null +++ b/modules/darwin/default.nix @@ -0,0 +1,15 @@ +{ + imports = [ + ./archetypes + ./desktop + ./home + ./nix + ./programs + ./security + ./services + ./suites + ./system + ./tools + ./user + ]; +} diff --git a/modules/darwin/desktop/addons/jankyborders/default.nix b/modules/darwin/desktop/addons/jankyborders/default.nix index 303d27851..15d6566d0 100644 --- a/modules/darwin/desktop/addons/jankyborders/default.nix +++ b/modules/darwin/desktop/addons/jankyborders/default.nix @@ -2,30 +2,28 @@ config, lib, pkgs, - namespace, + ... }: let - cfg = config.${namespace}.desktop.addons.jankyborders; + cfg = config.khanelinix.desktop.addons.jankyborders; in { - options.${namespace}.desktop.addons.jankyborders = { - enable = - lib.${namespace}.mkBoolOpt false - "Whether to enable jankyborders in the desktop environment."; + options.khanelinix.desktop.addons.jankyborders = { + enable = khanelinix-lib.mkBoolOpt false "Whether to enable jankyborders in the desktop environment."; package = lib.mkOption { type = lib.types.package; default = pkgs.jankyborders; defaultText = lib.literalExpression "pkgs.jankyborders"; description = "The jankyborders package to use."; - example = lib.literalExpression "pkgs.${namespace}.jankyborders"; + example = lib.literalExpression "self.packages.${system}.jankyborders"; }; }; config = lib.mkIf cfg.enable { environment.systemPackages = with pkgs; [ jankyborders ]; - ${namespace}.home.configFile = { + khanelinix.home.configFile = { "borders/bordersrc".source = pkgs.writeShellScript "bordersrc" # bash '' diff --git a/modules/darwin/desktop/addons/skhd/default.nix b/modules/darwin/desktop/addons/skhd/default.nix index d53dfdadd..6111dcd68 100644 --- a/modules/darwin/desktop/addons/skhd/default.nix +++ b/modules/darwin/desktop/addons/skhd/default.nix @@ -2,20 +2,20 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf getExe; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; sketchybar = getExe config.services.sketchybar.package; yabai = getExe config.services.yabai.package; - cfg = config.${namespace}.desktop.addons.skhd; + cfg = config.khanelinix.desktop.addons.skhd; in { - options.${namespace}.desktop.addons.skhd = { + options.khanelinix.desktop.addons.skhd = { enable = mkBoolOpt false "Whether or not to enable skhd."; logFile = mkOpt lib.types.str "/Users/khaneliman/Library/Logs/skhd.log" "Filepath of log output"; }; @@ -25,7 +25,7 @@ in systemPackages = [ config.services.skhd.package ]; }; - ${namespace}.home.extraOptions = { + khanelinix.home.extraOptions = { home.shellAliases = { restart-skhd = ''launchctl kickstart -k gui/"$(id -u)"/org.nixos.skhd''; }; @@ -251,7 +251,7 @@ in # Hot-reload workaround until https://github.com/koekeishiya/skhd/issues/342 is fixed system.activationScripts.postActivation.text = '' echo "Restarting skhd..." - launchctl kickstart -k gui/"$(id -u ${config.${namespace}.user.name})"/org.nixos.skhd + launchctl kickstart -k gui/"$(id -u ${config.khanelinix.user.name})"/org.nixos.skhd ''; }; } diff --git a/modules/darwin/desktop/bars/sketchybar/default.nix b/modules/darwin/desktop/bars/sketchybar/default.nix index 3b76183e7..1e6e4f407 100644 --- a/modules/darwin/desktop/bars/sketchybar/default.nix +++ b/modules/darwin/desktop/bars/sketchybar/default.nix @@ -2,16 +2,16 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.desktop.bars.sketchybar; + cfg = config.khanelinix.desktop.bars.sketchybar; in { - options.${namespace}.desktop.bars.sketchybar = { + options.khanelinix.desktop.bars.sketchybar = { enable = mkBoolOpt false "Whether or not to enable sketchybar."; logFile = mkOpt lib.types.str "/Users/khaneliman/Library/Logs/sketchybar.log" @@ -19,7 +19,7 @@ in }; config = lib.mkIf cfg.enable { - ${namespace}.home.extraOptions = { + khanelinix.home.extraOptions = { home.shellAliases = { restart-sketchybar = ''launchctl kickstart -k gui/"$(id -u)"/org.nixos.sketchybar''; }; @@ -44,8 +44,8 @@ in jq lua5_4 wttrbar - pkgs.${namespace}.sketchyhelper - pkgs.${namespace}.dynamic-island-helper + self.packages.${system}.sketchyhelper + self.packages.${system}.dynamic-island-helper ]; # TODO: need to update nixpkg to support complex configurations diff --git a/modules/darwin/desktop/wms/yabai/default.nix b/modules/darwin/desktop/wms/yabai/default.nix index 7abcb9f45..7ac38281f 100644 --- a/modules/darwin/desktop/wms/yabai/default.nix +++ b/modules/darwin/desktop/wms/yabai/default.nix @@ -2,24 +2,24 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) getExe; - inherit (lib.${namespace}) mkBoolOpt mkOpt enabled; + inherit (khanelinix-lib) mkBoolOpt mkOpt enabled; - cfg = config.${namespace}.desktop.wms.yabai; + cfg = config.khanelinix.desktop.wms.yabai; in { - options.${namespace}.desktop.wms.yabai = { + options.khanelinix.desktop.wms.yabai = { enable = mkBoolOpt false "Whether or not to enable yabai."; debug = mkBoolOpt false "Whether to enable debug output."; logFile = mkOpt lib.types.str "/Users/khaneliman/Library/Logs/yabai.log" "Filepath of log output"; }; config = lib.mkIf cfg.enable { - ${namespace} = { + khanelinix = { desktop.addons.jankyborders = enabled; home.extraOptions = { @@ -75,7 +75,7 @@ in extraConfig = let inherit (pkgs) sketchybar; - inherit (pkgs.${namespace}) yabai-helper; + inherit (self.packages.${system}) yabai-helper; yabai = config.services.yabai.package; in # bash @@ -100,7 +100,7 @@ in # ${getExe yabai} -m signal --add event=window_title_changed app="Firefox" title="- noVNC$" action="${getExe yabai} -m window $WINDOW_ID --toggle native-fullscreen" # jankyborders - ${getExe config.${namespace}.desktop.addons.jankyborders.package} 2>/dev/null 1>&2 & + ${getExe config.khanelinix.desktop.addons.jankyborders.package} 2>/dev/null 1>&2 & open ${pkgs.raycast}/Applications/Raycast.app diff --git a/modules/darwin/home/default.nix b/modules/darwin/home/default.nix index 750becf2d..e04d617a7 100644 --- a/modules/darwin/home/default.nix +++ b/modules/darwin/home/default.nix @@ -1,16 +1,20 @@ { config, + khanelinix-lib, lib, options, - namespace, + inputs, ... }: let - inherit (lib.${namespace}) mkOpt; + inherit (khanelinix-lib) mkOpt; in { + imports = lib.optional ( + inputs.home-manager ? nixosModules + ) inputs.home-manager.nixosModules.home-manager; - options.${namespace}.home = with lib.types; { + options.khanelinix.home = with lib.types; { file = mkOpt attrs { } "A set of files to be managed by home-manager's ."; configFile = mkOpt attrs { } @@ -19,16 +23,15 @@ in homeConfig = mkOpt attrs { } "Final config for home-manager."; }; - config = { - ${namespace}.home.extraOptions = { - home.file = lib.mkAliasDefinitions options.${namespace}.home.file; + config = lib.optionalAttrs (inputs.home-manager ? nixosModules) { + khanelinix.home.extraOptions = { + home.file = lib.mkAliasDefinitions options.khanelinix.home.file; xdg.enable = true; - xdg.configFile = lib.mkAliasDefinitions options.${namespace}.home.configFile; + xdg.configFile = lib.mkAliasDefinitions options.khanelinix.home.configFile; }; - snowfallorg.users.${config.${namespace}.user.name}.home.config = - lib.mkAliasDefinitions - options.${namespace}.home.extraOptions; + snowfallorg.users.${config.khanelinix.user.name}.home.config = + lib.mkAliasDefinitions options.khanelinix.home.extraOptions; home-manager = { # enables backing up existing files instead of erroring if conflicts exist diff --git a/modules/darwin/nix/default.nix b/modules/darwin/nix/default.nix index 5feeeb135..452a51e36 100644 --- a/modules/darwin/nix/default.nix +++ b/modules/darwin/nix/default.nix @@ -1,14 +1,14 @@ { config, lib, - namespace, + root, ... }: let - cfg = config.${namespace}.nix; + cfg = config.khanelinix.nix; in { - imports = [ (lib.snowfall.fs.get-file "modules/shared/nix/default.nix") ]; + imports = [ (root + "/modules/shared/nix/default.nix") ]; config = lib.mkIf cfg.enable { nix = { @@ -25,7 +25,7 @@ in Hour = 3; }; - user = config.${namespace}.user.name; + user = config.khanelinix.user.name; }; linux-builder = { @@ -49,7 +49,7 @@ in Hour = 4; }; - user = config.${namespace}.user.name; + user = config.khanelinix.user.name; }; # NOTE: not sure if i saw any benefits changing this diff --git a/modules/darwin/programs/graphical/apps/_1password/default.nix b/modules/darwin/programs/graphical/apps/_1password/default.nix index 2ae65091c..f7a728ac8 100644 --- a/modules/darwin/programs/graphical/apps/_1password/default.nix +++ b/modules/darwin/programs/graphical/apps/_1password/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.apps._1password; + cfg = config.khanelinix.programs.graphical.apps._1password; in { - options.${namespace}.programs.graphical.apps._1password = { + options.khanelinix.programs.graphical.apps._1password = { enable = mkBoolOpt false "Whether or not to enable 1password."; }; @@ -21,7 +21,7 @@ in casks = [ "1password" ]; - masApps = mkIf config.${namespace}.tools.homebrew.masEnable { + masApps = mkIf config.khanelinix.tools.homebrew.masEnable { "1Password for Safari" = 1569813296; }; }; diff --git a/modules/darwin/programs/terminal/tools/ssh/default.nix b/modules/darwin/programs/terminal/tools/ssh/default.nix index 0475d4404..5303503b1 100644 --- a/modules/darwin/programs/terminal/tools/ssh/default.nix +++ b/modules/darwin/programs/terminal/tools/ssh/default.nix @@ -1,7 +1,7 @@ { - lib, + root, ... }: { - imports = [ (lib.snowfall.fs.get-file "modules/shared/programs/terminal/tools/ssh/default.nix") ]; + imports = [ (root + "/modules/shared/programs/terminal/tools/ssh/default.nix") ]; } diff --git a/modules/darwin/security/gpg/default.nix b/modules/darwin/security/gpg/default.nix index 645d48223..914ad4c2c 100644 --- a/modules/darwin/security/gpg/default.nix +++ b/modules/darwin/security/gpg/default.nix @@ -2,7 +2,7 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let @@ -12,9 +12,9 @@ let mkIf getExe' ; - inherit (lib.${namespace}) mkOpt; + inherit (khanelinix-lib) mkOpt; - cfg = config.${namespace}.security.gpg; + cfg = config.khanelinix.security.gpg; gpgAgentConf = '' enable-ssh-support @@ -23,7 +23,7 @@ let ''; in { - options.${namespace}.security.gpg = { + options.khanelinix.security.gpg = { enable = mkEnableOption "GPG"; agentTimeout = mkOpt types.int 5 "The amount of time to wait before continuing with shell init."; }; @@ -51,7 +51,7 @@ in enableSSHSupport = true; }; - ${namespace}.home.file = { + khanelinix.home.file = { ".gnupg/.keep".text = ""; ".gnupg/gpg-agent.conf".text = gpgAgentConf; }; diff --git a/modules/darwin/security/sops/default.nix b/modules/darwin/security/sops/default.nix index 1c977f3b2..29e45e4ef 100644 --- a/modules/darwin/security/sops/default.nix +++ b/modules/darwin/security/sops/default.nix @@ -1,35 +1,39 @@ { config, + inputs, + khanelinix-lib, lib, - namespace, + root, ... }: let - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.security.sops; + cfg = config.khanelinix.security.sops; in { - options.${namespace}.security.sops = with lib.types; { + imports = lib.optional (inputs.sops-nix ? darwinModules) inputs.sops-nix.darwinModules.sops; + + options.khanelinix.security.sops = with lib.types; { enable = mkBoolOpt false "Whether to enable sops."; defaultSopsFile = mkOpt path null "Default sops file."; sshKeyPaths = mkOpt (listOf path) [ "/etc/ssh/ssh_host_ed25519_key" ] "SSH Key paths to use."; }; - config = lib.mkIf cfg.enable { + config = lib.mkIf (cfg.enable && (inputs.sops-nix ? darwinModules)) { sops = { inherit (cfg) defaultSopsFile; age = { inherit (cfg) sshKeyPaths; - keyFile = "${config.users.users.${config.${namespace}.user.name}.home}/.config/sops/age/keys.txt"; + keyFile = "${config.users.users.${config.khanelinix.user.name}.home}/.config/sops/age/keys.txt"; }; }; sops.secrets = { "khanelimac_khaneliman_ssh_key" = { - sopsFile = lib.snowfall.fs.get-file "secrets/khanelimac/khaneliman/default.yaml"; + sopsFile = root + "/secrets/khanelimac/khaneliman/default.yaml"; }; }; }; diff --git a/modules/darwin/services/nix-daemon/default.nix b/modules/darwin/services/nix-daemon/default.nix index 487f9e64d..b3646d3e1 100644 --- a/modules/darwin/services/nix-daemon/default.nix +++ b/modules/darwin/services/nix-daemon/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) types mkIf; - inherit (lib.${namespace}) mkOpt enabled; + inherit (khanelinix-lib) mkOpt enabled; - cfg = config.${namespace}.services.nix-daemon; + cfg = config.khanelinix.services.nix-daemon; in { - options.${namespace}.services.nix-daemon = { + options.khanelinix.services.nix-daemon = { enable = mkOpt types.bool true "Whether to enable the Nix daemon."; }; diff --git a/modules/darwin/services/tailscale/default.nix b/modules/darwin/services/tailscale/default.nix index e4e79a5f9..5f6c4aa26 100644 --- a/modules/darwin/services/tailscale/default.nix +++ b/modules/darwin/services/tailscale/default.nix @@ -1,18 +1,18 @@ { config, lib, - namespace, + khanelinix-lib, pkgs, ... }: let inherit (lib) types mkIf; - inherit (lib.${namespace}) mkOpt; + inherit (khanelinix-lib) mkOpt; - cfg = config.${namespace}.services.tailscale; + cfg = config.khanelinix.services.tailscale; in { - options.${namespace}.services.tailscale = { + options.khanelinix.services.tailscale = { enable = mkOpt types.bool true "Whether to enable the Nix daemon."; }; diff --git a/modules/darwin/suites/art/default.nix b/modules/darwin/suites/art/default.nix index eb34e4bf7..c05287ab9 100644 --- a/modules/darwin/suites/art/default.nix +++ b/modules/darwin/suites/art/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.art; + cfg = config.khanelinix.suites.art; in { - options.${namespace}.suites.art = { + options.khanelinix.suites.art = { enable = mkBoolOpt false "Whether or not to enable art configuration."; }; @@ -30,7 +30,7 @@ in "mediainfo" ]; - masApps = mkIf config.${namespace}.tools.homebrew.masEnable { "Pixelmator" = 407963104; }; + masApps = mkIf config.khanelinix.tools.homebrew.masEnable { "Pixelmator" = 407963104; }; }; }; } diff --git a/modules/darwin/suites/business/default.nix b/modules/darwin/suites/business/default.nix index dc4e57007..0c088327d 100644 --- a/modules/darwin/suites/business/default.nix +++ b/modules/darwin/suites/business/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.suites.business; + cfg = config.khanelinix.suites.business; in { - options.${namespace}.suites.business = { + options.khanelinix.suites.business = { enable = mkBoolOpt false "Whether or not to enable business configuration."; }; @@ -28,7 +28,7 @@ in "thunderbird" ]; - masApps = mkIf config.${namespace}.tools.homebrew.masEnable { + masApps = mkIf config.khanelinix.tools.homebrew.masEnable { "Brother iPrint&Scan" = 1193539993; "Keynote" = 409183694; "Microsoft OneNote" = 784801555; diff --git a/modules/darwin/suites/common/default.nix b/modules/darwin/suites/common/default.nix index 9f04432e7..75ccf5adf 100644 --- a/modules/darwin/suites/common/default.nix +++ b/modules/darwin/suites/common/default.nix @@ -2,17 +2,18 @@ config, lib, pkgs, - namespace, + khanelinix-lib, + root, ... }: let inherit (lib) mkIf mkDefault; - inherit (lib.${namespace}) enabled; + inherit (khanelinix-lib) enabled; - cfg = config.${namespace}.suites.common; + cfg = config.khanelinix.suites.common; in { - imports = [ (lib.snowfall.fs.get-file "modules/shared/suites/common/default.nix") ]; + imports = [ (root + "/modules/shared/suites/common/default.nix") ]; config = mkIf cfg.enable { programs.zsh.enable = mkDefault true; @@ -31,8 +32,8 @@ in gnupg gnused gnutls - pkgs.${namespace}.trace-symlink - pkgs.${namespace}.trace-which + self.packages.${system}.trace-symlink + self.packages.${system}.trace-which mas terminal-notifier trash-cli diff --git a/modules/darwin/suites/desktop/default.nix b/modules/darwin/suites/desktop/default.nix index 431d5b437..e7563b4d3 100644 --- a/modules/darwin/suites/desktop/default.nix +++ b/modules/darwin/suites/desktop/default.nix @@ -1,18 +1,18 @@ { config, lib, - namespace, + khanelinix-lib, pkgs, ... }: let inherit (lib) mkIf mkDefault; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.suites.desktop; + cfg = config.khanelinix.suites.desktop; in { - options.${namespace}.suites.desktop = { + options.khanelinix.suites.desktop = { enable = mkBoolOpt false "Whether or not to enable common desktop configuration."; }; @@ -30,7 +30,7 @@ in # xquartz ]; - ${namespace}.desktop = { + khanelinix.desktop = { addons = { skhd = mkDefault enabled; jankyborders = mkDefault enabled; @@ -67,7 +67,7 @@ in "khanhas/tap" ]; - masApps = mkIf config.${namespace}.tools.homebrew.masEnable { + masApps = mkIf config.khanelinix.tools.homebrew.masEnable { "AmorphousMemoryMark" = 1495719766; "Amphetamine" = 937984704; "AutoMounter" = 1160435653; diff --git a/modules/darwin/suites/development/default.nix b/modules/darwin/suites/development/default.nix index 565e7bf4d..76b6d84ee 100644 --- a/modules/darwin/suites/development/default.nix +++ b/modules/darwin/suites/development/default.nix @@ -1,18 +1,18 @@ { config, + khanelinix-lib, lib, - namespace, pkgs, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.development; + cfg = config.khanelinix.suites.development; in { - options.${namespace}.suites.development = { + options.khanelinix.suites.development = { enable = mkBoolOpt false "Whether or not to enable common development configuration."; }; @@ -29,7 +29,7 @@ in "powershell" ]; - masApps = mkIf config.${namespace}.tools.homebrew.masEnable { + masApps = mkIf config.khanelinix.tools.homebrew.masEnable { "Patterns" = 429449079; "Xcode" = 497799835; }; diff --git a/modules/darwin/suites/games/default.nix b/modules/darwin/suites/games/default.nix index 0963fd540..3b2e6da0f 100644 --- a/modules/darwin/suites/games/default.nix +++ b/modules/darwin/suites/games/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.games; + cfg = config.khanelinix.suites.games; in { - options.${namespace}.suites.games = { + options.khanelinix.suites.games = { enable = mkBoolOpt false "Whether or not to enable games configuration."; }; diff --git a/modules/darwin/suites/music/default.nix b/modules/darwin/suites/music/default.nix index 7d17d5837..8b2453c7d 100644 --- a/modules/darwin/suites/music/default.nix +++ b/modules/darwin/suites/music/default.nix @@ -1,23 +1,23 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.music; + cfg = config.khanelinix.suites.music; in { - options.${namespace}.suites.music = { + options.khanelinix.suites.music = { enable = mkBoolOpt false "Whether or not to enable music configuration."; }; config = mkIf cfg.enable { homebrew = { - masApps = mkIf config.${namespace}.tools.homebrew.masEnable { "GarageBand" = 682658836; }; + masApps = mkIf config.khanelinix.tools.homebrew.masEnable { "GarageBand" = 682658836; }; }; }; } diff --git a/modules/darwin/suites/networking/default.nix b/modules/darwin/suites/networking/default.nix index ec3c919f3..16f4a52eb 100644 --- a/modules/darwin/suites/networking/default.nix +++ b/modules/darwin/suites/networking/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.suites.networking; + cfg = config.khanelinix.suites.networking; in { - options.${namespace}.suites.networking = { + options.khanelinix.suites.networking = { enable = mkBoolOpt false "Whether or not to enable networking configuration."; }; diff --git a/modules/darwin/suites/photo/default.nix b/modules/darwin/suites/photo/default.nix index 550e5e4da..900926290 100644 --- a/modules/darwin/suites/photo/default.nix +++ b/modules/darwin/suites/photo/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.photo; + cfg = config.khanelinix.suites.photo; in { - options.${namespace}.suites.photo = { + options.khanelinix.suites.photo = { enable = mkBoolOpt false "Whether or not to enable photo configuration."; }; diff --git a/modules/darwin/suites/social/default.nix b/modules/darwin/suites/social/default.nix index 62c308dfc..0267c43c7 100644 --- a/modules/darwin/suites/social/default.nix +++ b/modules/darwin/suites/social/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.social; + cfg = config.khanelinix.suites.social; in { - options.${namespace}.suites.social = { + options.khanelinix.suites.social = { enable = mkBoolOpt false "Whether or not to enable social configuration."; }; diff --git a/modules/darwin/suites/video/default.nix b/modules/darwin/suites/video/default.nix index b3e9dee84..741b41cdb 100644 --- a/modules/darwin/suites/video/default.nix +++ b/modules/darwin/suites/video/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.video; + cfg = config.khanelinix.suites.video; in { - options.${namespace}.suites.video = { + options.khanelinix.suites.video = { enable = mkBoolOpt false "Whether or not to enable video configuration."; }; @@ -24,7 +24,7 @@ in "plex" ]; - masApps = mkIf config.${namespace}.tools.homebrew.masEnable { + masApps = mkIf config.khanelinix.tools.homebrew.masEnable { "Infuse" = 1136220934; "iMovie" = 408981434; }; diff --git a/modules/darwin/suites/vm/default.nix b/modules/darwin/suites/vm/default.nix index 72cfd2eeb..da010d4ca 100644 --- a/modules/darwin/suites/vm/default.nix +++ b/modules/darwin/suites/vm/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.vm; + cfg = config.khanelinix.suites.vm; in { - options.${namespace}.suites.vm = { + options.khanelinix.suites.vm = { enable = mkBoolOpt false "Whether or not to enable vm."; }; diff --git a/modules/darwin/system/fonts/default.nix b/modules/darwin/system/fonts/default.nix index adcbc4406..0222d40fa 100644 --- a/modules/darwin/system/fonts/default.nix +++ b/modules/darwin/system/fonts/default.nix @@ -2,16 +2,16 @@ config, pkgs, lib, - namespace, + root, ... }: let inherit (lib) mkIf; - cfg = config.${namespace}.system.fonts; + cfg = config.khanelinix.system.fonts; in { - imports = [ (lib.snowfall.fs.get-file "modules/shared/system/fonts/default.nix") ]; + imports = [ (root + "/modules/shared/system/fonts/default.nix") ]; config = mkIf cfg.enable { fonts = { diff --git a/modules/darwin/system/input/default.nix b/modules/darwin/system/input/default.nix index 543b1d069..9c0784ee4 100644 --- a/modules/darwin/system/input/default.nix +++ b/modules/darwin/system/input/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + ... }: let inherit (lib) mkIf mkMerge mkEnableOption; - cfg = config.${namespace}.system.input; + cfg = config.khanelinix.system.input; in { - options.${namespace}.system.input = { + options.khanelinix.system.input = { enable = mkEnableOption "macOS input"; }; diff --git a/modules/darwin/system/interface/default.nix b/modules/darwin/system/interface/default.nix index f066c479c..e710c309d 100644 --- a/modules/darwin/system/interface/default.nix +++ b/modules/darwin/system/interface/default.nix @@ -1,22 +1,22 @@ { config, lib, - namespace, + pkgs, ... }: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.system.interface; + cfg = config.khanelinix.system.interface; in { - options.${namespace}.system.interface = { + options.khanelinix.system.interface = { enable = mkEnableOption "macOS interface"; }; config = mkIf cfg.enable { - ${namespace}.home.file = { + khanelinix.home.file = { "Pictures/screenshots/.keep".text = ""; }; @@ -168,7 +168,7 @@ in screencapture = { disable-shadow = true; - location = "/Users/${config.${namespace}.user.name}/Pictures/screenshots/"; + location = "/Users/${config.khanelinix.user.name}/Pictures/screenshots/"; type = "png"; }; diff --git a/modules/darwin/system/networking/default.nix b/modules/darwin/system/networking/default.nix index 943f6afa3..43e21c8ee 100644 --- a/modules/darwin/system/networking/default.nix +++ b/modules/darwin/system/networking/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.system.networking; + cfg = config.khanelinix.system.networking; in { - options.${namespace}.system.networking = { + options.khanelinix.system.networking = { enable = mkBoolOpt false "Whether or not to enable networking support"; }; diff --git a/modules/darwin/tools/homebrew/default.nix b/modules/darwin/tools/homebrew/default.nix index 44beb1961..9c1dd59a0 100644 --- a/modules/darwin/tools/homebrew/default.nix +++ b/modules/darwin/tools/homebrew/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.tools.homebrew; + cfg = config.khanelinix.tools.homebrew; in { - options.${namespace}.tools.homebrew = { + options.khanelinix.tools.homebrew = { enable = mkBoolOpt false "Whether or not to enable homebrew."; masEnable = mkBoolOpt false "Whether or not to enable Mac App Store downloads."; }; diff --git a/modules/darwin/user/default.nix b/modules/darwin/user/default.nix index 1c645de01..39ca0dc9f 100644 --- a/modules/darwin/user/default.nix +++ b/modules/darwin/user/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) types mkIf; - inherit (lib.${namespace}) mkOpt; + inherit (khanelinix-lib) mkOpt; - cfg = config.${namespace}.user; + cfg = config.khanelinix.user; in { - options.${namespace}.user = { + options.khanelinix.user = { name = mkOpt types.str "khaneliman" "The user account."; email = mkOpt types.str "khaneliman12@gmail.com" "The email of the user."; fullName = mkOpt types.str "Austin Horstman" "The full name of the user."; diff --git a/modules/home/default.nix b/modules/home/default.nix new file mode 100644 index 000000000..983cfb8aa --- /dev/null +++ b/modules/home/default.nix @@ -0,0 +1,11 @@ +{ + imports = [ + ./host + ./programs + ./services + ./suites + ./system + ./theme + ./user + ]; +} diff --git a/modules/home/host/default.nix b/modules/home/host/default.nix index b03383080..cb852f138 100644 --- a/modules/home/host/default.nix +++ b/modules/home/host/default.nix @@ -1,15 +1,15 @@ { lib, host ? null, - namespace, + khanelinix-lib, ... }: let inherit (lib) types; - inherit (lib.${namespace}) mkOpt; + inherit (khanelinix-lib) mkOpt; in { - options.${namespace}.host = { + options.khanelinix.host = { name = mkOpt (types.nullOr types.str) host "The host name."; }; } diff --git a/modules/home/programs/graphical/addons/electron-support/default.nix b/modules/home/programs/graphical/addons/electron-support/default.nix index 74138a8a3..b3dad92c4 100644 --- a/modules/home/programs/graphical/addons/electron-support/default.nix +++ b/modules/home/programs/graphical/addons/electron-support/default.nix @@ -1,17 +1,17 @@ { config, + khanelinix-lib, lib, - namespace, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.addons.electron-support; + cfg = config.khanelinix.programs.graphical.addons.electron-support; in { - options.${namespace}.programs.graphical.addons.electron-support = { + options.khanelinix.programs.graphical.addons.electron-support = { enable = mkBoolOpt false "Whether to enable wayland electron support in the desktop environment."; }; diff --git a/modules/home/programs/graphical/addons/kanshi/default.nix b/modules/home/programs/graphical/addons/kanshi/default.nix index 4fd34b4ad..6c88cffd9 100644 --- a/modules/home/programs/graphical/addons/kanshi/default.nix +++ b/modules/home/programs/graphical/addons/kanshi/default.nix @@ -1,20 +1,20 @@ { config, + khanelinix-lib, lib, pkgs, - namespace, ... }: let inherit (lib) mkIf getExe; - inherit (lib.${namespace}) mkBoolOpt; - inherit (config.${namespace}) user; + inherit (khanelinix-lib) mkBoolOpt; + inherit (config.khanelinix) user; inherit (config.users.users.${user.name}) home; - cfg = config.${namespace}.programs.graphical.addons.kanshi; + cfg = config.khanelinix.programs.graphical.addons.kanshi; in { - options.${namespace}.programs.graphical.addons.kanshi = { + options.khanelinix.programs.graphical.addons.kanshi = { enable = mkBoolOpt false "Whether to enable Kanshi in the desktop environment."; }; diff --git a/modules/home/programs/graphical/addons/looking-glass-client/default.nix b/modules/home/programs/graphical/addons/looking-glass-client/default.nix index 680a85f9e..26599e307 100644 --- a/modules/home/programs/graphical/addons/looking-glass-client/default.nix +++ b/modules/home/programs/graphical/addons/looking-glass-client/default.nix @@ -1,18 +1,18 @@ { config, + khanelinix-lib, lib, pkgs, - namespace, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.addons.looking-glass-client; + cfg = config.khanelinix.programs.graphical.addons.looking-glass-client; in { - options.${namespace}.programs.graphical.addons.looking-glass-client = { + options.khanelinix.programs.graphical.addons.looking-glass-client = { enable = mkBoolOpt false "Whether or not to enable the Looking Glass client."; }; diff --git a/modules/home/programs/graphical/addons/mako/default.nix b/modules/home/programs/graphical/addons/mako/default.nix index 8bc782a1b..3bfc45787 100644 --- a/modules/home/programs/graphical/addons/mako/default.nix +++ b/modules/home/programs/graphical/addons/mako/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + ... }: let inherit (lib) mkIf getExe getExe'; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.addons.mako; + cfg = config.khanelinix.programs.graphical.addons.mako; in { - options.${namespace}.programs.graphical.addons.mako = { + options.khanelinix.programs.graphical.addons.mako = { enable = mkBoolOpt false "Whether to enable Mako in Sway."; }; diff --git a/modules/home/programs/graphical/addons/mangohud/default.nix b/modules/home/programs/graphical/addons/mangohud/default.nix index 43b6266c1..7276ae574 100644 --- a/modules/home/programs/graphical/addons/mangohud/default.nix +++ b/modules/home/programs/graphical/addons/mangohud/default.nix @@ -1,18 +1,18 @@ { config, + khanelinix-lib, lib, pkgs, - namespace, ... }: let inherit (lib) mkIf literalExpression; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.mangohud; + cfg = config.khanelinix.programs.graphical.mangohud; in { - options.${namespace}.programs.graphical.mangohud = { + options.khanelinix.programs.graphical.mangohud = { enable = mkBoolOpt false "Whether or not to enable mangohud."; }; diff --git a/modules/home/programs/graphical/addons/swappy/default.nix b/modules/home/programs/graphical/addons/swappy/default.nix index d25090f95..3546294db 100644 --- a/modules/home/programs/graphical/addons/swappy/default.nix +++ b/modules/home/programs/graphical/addons/swappy/default.nix @@ -1,18 +1,18 @@ { config, + khanelinix-lib, lib, pkgs, - namespace, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.addons.swappy; + cfg = config.khanelinix.programs.graphical.addons.swappy; in { - options.${namespace}.programs.graphical.addons.swappy = { + options.khanelinix.programs.graphical.addons.swappy = { enable = mkBoolOpt false "Whether to enable Swappy in the desktop environment."; }; diff --git a/modules/home/programs/graphical/addons/swaync/default.nix b/modules/home/programs/graphical/addons/swaync/default.nix index 12599a917..9fccd8420 100644 --- a/modules/home/programs/graphical/addons/swaync/default.nix +++ b/modules/home/programs/graphical/addons/swaync/default.nix @@ -1,16 +1,16 @@ { config, + khanelinix-lib, lib, osConfig, pkgs, - namespace, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.addons.swaync; + cfg = config.khanelinix.programs.graphical.addons.swaync; dependencies = with pkgs; [ bash @@ -29,7 +29,7 @@ let style = import ./style.nix; in { - options.${namespace}.programs.graphical.addons.swaync = { + options.khanelinix.programs.graphical.addons.swaync = { enable = mkBoolOpt false "Whether to enable swaync in the desktop environment."; }; diff --git a/modules/home/programs/graphical/addons/wlogout/default.nix b/modules/home/programs/graphical/addons/wlogout/default.nix index b65340b4b..7da6ddea5 100644 --- a/modules/home/programs/graphical/addons/wlogout/default.nix +++ b/modules/home/programs/graphical/addons/wlogout/default.nix @@ -1,18 +1,18 @@ { config, + khanelinix-lib, lib, - namespace, pkgs, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.addons.wlogout; + cfg = config.khanelinix.programs.graphical.addons.wlogout; in { - options.${namespace}.programs.graphical.addons.wlogout = { + options.khanelinix.programs.graphical.addons.wlogout = { enable = mkBoolOpt false "Whether to enable wlogout in the desktop environment."; }; diff --git a/modules/home/programs/graphical/apps/caprine/default.nix b/modules/home/programs/graphical/apps/caprine/default.nix index a80e7007a..ce78fdff4 100644 --- a/modules/home/programs/graphical/apps/caprine/default.nix +++ b/modules/home/programs/graphical/apps/caprine/default.nix @@ -2,16 +2,16 @@ config, lib, pkgs, - namespace, + ... }: let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.programs.graphical.apps.caprine; + cfg = config.khanelinix.programs.graphical.apps.caprine; in { - options.${namespace}.programs.graphical.apps.caprine = { + options.khanelinix.programs.graphical.apps.caprine = { enable = mkEnableOption "caprine"; }; diff --git a/modules/home/programs/graphical/apps/discord/default.nix b/modules/home/programs/graphical/apps/discord/default.nix index 9ea591974..f3a182879 100644 --- a/modules/home/programs/graphical/apps/discord/default.nix +++ b/modules/home/programs/graphical/apps/discord/default.nix @@ -1,20 +1,22 @@ { config, inputs, + khanelinix-lib, lib, - namespace, pkgs, + self, + system, ... }: let inherit (lib) mkIf getExe; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; inherit (inputs) home-manager; - cfg = config.${namespace}.programs.graphical.apps.discord; + cfg = config.khanelinix.programs.graphical.apps.discord; in { - options.${namespace}.programs.graphical.apps.discord = { + options.khanelinix.programs.graphical.apps.discord = { enable = mkBoolOpt false "Whether or not to enable Discord."; canary.enable = mkBoolOpt false "Whether or not to enable Discord Canary."; firefox.enable = mkBoolOpt false "Whether or not to enable the Firefox version of Discord."; @@ -24,8 +26,8 @@ in home = { packages = lib.optional cfg.enable pkgs.discord - ++ lib.optional cfg.canary.enable pkgs.${namespace}.discord - ++ lib.optional cfg.firefox.enable pkgs.${namespace}.discord-firefox; + ++ lib.optional cfg.canary.enable self.packages.${system}.discord + ++ lib.optional cfg.firefox.enable self.packages.${system}.discord-firefox; activation = mkIf pkgs.stdenv.isLinux { betterdiscordInstall = # bash diff --git a/modules/home/programs/graphical/apps/mpv/default.nix b/modules/home/programs/graphical/apps/mpv/default.nix index d5e7dd5ea..d15bebe35 100644 --- a/modules/home/programs/graphical/apps/mpv/default.nix +++ b/modules/home/programs/graphical/apps/mpv/default.nix @@ -1,19 +1,19 @@ { config, + khanelinix-lib, lib, pkgs, - namespace, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.apps.mpv; + cfg = config.khanelinix.programs.graphical.apps.mpv; in { - options.${namespace}.programs.graphical.apps.mpv = { + options.khanelinix.programs.graphical.apps.mpv = { enable = mkBoolOpt false "Whether or not to enable support for mpv."; }; diff --git a/modules/home/programs/graphical/apps/obs/default.nix b/modules/home/programs/graphical/apps/obs/default.nix index 84592f619..3b63dc592 100644 --- a/modules/home/programs/graphical/apps/obs/default.nix +++ b/modules/home/programs/graphical/apps/obs/default.nix @@ -1,17 +1,17 @@ { config, + khanelinix-lib, lib, pkgs, - namespace, ... }: let - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.apps.obs; + cfg = config.khanelinix.programs.graphical.apps.obs; in { - options.${namespace}.programs.graphical.apps.obs = { + options.khanelinix.programs.graphical.apps.obs = { enable = mkBoolOpt false "Whether or not to enable support for OBS."; }; diff --git a/modules/home/programs/graphical/apps/retroarch/default.nix b/modules/home/programs/graphical/apps/retroarch/default.nix index ab69c46cf..b47da12be 100644 --- a/modules/home/programs/graphical/apps/retroarch/default.nix +++ b/modules/home/programs/graphical/apps/retroarch/default.nix @@ -1,18 +1,18 @@ { config, + khanelinix-lib, lib, pkgs, - namespace, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.apps.retroarch; + cfg = config.khanelinix.programs.graphical.apps.retroarch; in { - options.${namespace}.programs.graphical.apps.retroarch = { + options.khanelinix.programs.graphical.apps.retroarch = { enable = mkBoolOpt false "Whether or not to enable retroarch."; }; diff --git a/modules/home/programs/graphical/apps/thunderbird/default.nix b/modules/home/programs/graphical/apps/thunderbird/default.nix index cdbdd5d30..23ac08768 100644 --- a/modules/home/programs/graphical/apps/thunderbird/default.nix +++ b/modules/home/programs/graphical/apps/thunderbird/default.nix @@ -1,18 +1,18 @@ { config, + khanelinix-lib, lib, pkgs, - namespace, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.programs.graphical.apps.thunderbird; + cfg = config.khanelinix.programs.graphical.apps.thunderbird; in { - options.${namespace}.programs.graphical.apps.thunderbird = { + options.khanelinix.programs.graphical.apps.thunderbird = { enable = mkBoolOpt false "Whether or not to enable thunderbird."; extraAccounts = lib.mkOption { type = @@ -57,11 +57,11 @@ in }: { inherit address primary flavor; - realName = config.${namespace}.user.fullName; + realName = config.khanelinix.user.fullName; thunderbird = { enable = true; profiles = [ - config.${namespace}.user.name + config.khanelinix.user.name ]; settings = id: { "mail.server.server_${id}.authMethod" = 10; @@ -71,8 +71,8 @@ in }; in { - "${config.${namespace}.user.email}" = mkEmailConfig { - address = config.${namespace}.user.email; + "${config.khanelinix.user.email}" = mkEmailConfig { + address = config.khanelinix.user.email; primary = true; flavor = "gmail.com"; }; @@ -85,7 +85,7 @@ in # yeah, yeah... darwinSetupWarning = false; - profiles.${config.${namespace}.user.name} = { + profiles.${config.khanelinix.user.name} = { isDefault = true; settings = { diff --git a/modules/home/programs/graphical/apps/zathura/default.nix b/modules/home/programs/graphical/apps/zathura/default.nix index cea1d8b8e..f4acf4612 100644 --- a/modules/home/programs/graphical/apps/zathura/default.nix +++ b/modules/home/programs/graphical/apps/zathura/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + ... }: let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.programs.graphical.apps.zathura; + cfg = config.khanelinix.programs.graphical.apps.zathura; in { - options.${namespace}.programs.graphical.apps.zathura = { + options.khanelinix.programs.graphical.apps.zathura = { enable = mkEnableOption "zathura"; }; diff --git a/modules/home/programs/graphical/bars/sketchybar/default.nix b/modules/home/programs/graphical/bars/sketchybar/default.nix index 1a2b3bad3..9b9ed4df7 100644 --- a/modules/home/programs/graphical/bars/sketchybar/default.nix +++ b/modules/home/programs/graphical/bars/sketchybar/default.nix @@ -2,14 +2,14 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf getExe; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.bars.sketchybar; + cfg = config.khanelinix.programs.graphical.bars.sketchybar; shellAliases = with pkgs; { push = # bash @@ -17,7 +17,7 @@ let }; in { - options.${namespace}.programs.graphical.bars.sketchybar = { + options.khanelinix.programs.graphical.bars.sketchybar = { enable = mkBoolOpt false "Whether to enable sketchybar in the desktop environment."; }; @@ -50,7 +50,9 @@ in -- Add the sketchybar module to the package cpath (the module could be -- installed into the default search path then this would not be needed) - package.cpath = package.cpath .. ";${pkgs.khanelinix.sbarlua}/lib/lua/${pkgs.lua.luaversion}/sketchybar.so" + package.cpath = package.cpath .. ";${ + self.packages.${system}.sbarlua + }/lib/lua/${pkgs.lua.luaversion}/sketchybar.so" Sbar = require("sketchybar") Sbar.exec("killall sketchyhelper || sketchyhelper git.felix.sketchyhelper >/dev/null 2>&1 &") diff --git a/modules/home/programs/graphical/bars/waybar/default.nix b/modules/home/programs/graphical/bars/waybar/default.nix index 3ba1e7cab..0dc0c94e5 100644 --- a/modules/home/programs/graphical/bars/waybar/default.nix +++ b/modules/home/programs/graphical/bars/waybar/default.nix @@ -1,10 +1,11 @@ { config, inputs, + khanelinix-lib, lib, pkgs, system, - namespace, + root, osConfig, ... }: @@ -16,10 +17,10 @@ let mkMerge types ; - inherit (lib.${namespace}) mkOpt mkBoolOpt; + inherit (khanelinix-lib) mkOpt mkBoolOpt; inherit (inputs) waybar; - cfg = config.${namespace}.programs.graphical.bars.waybar; + cfg = config.khanelinix.programs.graphical.bars.waybar; style = builtins.readFile ./styles/style.css; controlCenterStyle = builtins.readFile ./styles/control-center.css; @@ -29,7 +30,7 @@ let custom-modules = import ./modules/custom-modules.nix { inherit config lib pkgs; }; default-modules = import ./modules/default-modules.nix { inherit lib pkgs; }; - group-modules = import ./modules/group-modules.nix { inherit lib namespace osConfig; }; + group-modules = import ./modules/group-modules.nix { inherit lib osConfig; }; hyprland-modules = import ./modules/hyprland-modules.nix { inherit config lib; }; sway-modules = import ./modules/sway-modules.nix { inherit config lib; }; @@ -43,13 +44,13 @@ let modules-left = [ "custom/power" ] - ++ lib.optionals config.${namespace}.programs.graphical.wms.hyprland.enable [ + ++ lib.optionals config.khanelinix.programs.graphical.wms.hyprland.enable [ "hyprland/workspaces" ] - ++ lib.optionals config.${namespace}.programs.graphical.wms.sway.enable [ "sway/workspaces" ] + ++ lib.optionals config.khanelinix.programs.graphical.wms.sway.enable [ "sway/workspaces" ] ++ [ "custom/separator-left" ] - ++ lib.optionals config.${namespace}.programs.graphical.wms.hyprland.enable [ "hyprland/window" ] - ++ lib.optionals config.${namespace}.programs.graphical.wms.sway.enable [ "sway/window" ]; + ++ lib.optionals config.khanelinix.programs.graphical.wms.hyprland.enable [ "hyprland/window" ] + ++ lib.optionals config.khanelinix.programs.graphical.wms.sway.enable [ "sway/window" ]; }; fullSizeModules = { @@ -61,7 +62,7 @@ let "custom/separator-right" "group/control-center" ] - ++ lib.optionals config.${namespace}.programs.graphical.wms.hyprland.enable [ "hyprland/submap" ] + ++ lib.optionals config.khanelinix.programs.graphical.wms.hyprland.enable [ "hyprland/submap" ] ++ [ "custom/weather" "clock" @@ -75,7 +76,7 @@ let "group/stats-drawer" "group/control-center" ] - ++ lib.optionals config.${namespace}.programs.graphical.wms.hyprland.enable [ "hyprland/submap" ] + ++ lib.optionals config.khanelinix.programs.graphical.wms.hyprland.enable [ "hyprland/submap" ] ++ [ "custom/weather" "clock" @@ -90,8 +91,8 @@ let custom-modules default-modules group-modules - (lib.mkIf config.${namespace}.programs.graphical.wms.hyprland.enable hyprland-modules) - (lib.mkIf config.${namespace}.programs.graphical.wms.sway.enable sway-modules) + (lib.mkIf config.khanelinix.programs.graphical.wms.hyprland.enable hyprland-modules) + (lib.mkIf config.khanelinix.programs.graphical.wms.sway.enable sway-modules) ]; generateOutputSettings = @@ -107,7 +108,7 @@ let ); in { - options.${namespace}.programs.graphical.bars.waybar = { + options.khanelinix.programs.graphical.bars.waybar = { enable = mkBoolOpt false "Whether to enable waybar in the desktop environment."; debug = mkBoolOpt false "Whether to enable debug mode."; fullSizeOutputs = @@ -140,9 +141,9 @@ in style = "${style}${controlCenterStyle}${powerStyle}${statsStyle}${workspacesStyle}"; }; - sops.secrets = lib.mkIf osConfig.${namespace}.security.sops.enable { + sops.secrets = lib.mkIf osConfig.khanelinix.security.sops.enable { weather_config = { - sopsFile = lib.snowfall.fs.get-file "secrets/khaneliman/default.yaml"; + sopsFile = root + "/secrets/khaneliman/default.yaml"; path = "${config.home.homeDirectory}/weather_config.json"; }; }; diff --git a/modules/home/programs/graphical/bars/waybar/modules/default-modules.nix b/modules/home/programs/graphical/bars/waybar/modules/default-modules.nix index 1e628c09c..d0d4f58d8 100644 --- a/modules/home/programs/graphical/bars/waybar/modules/default-modules.nix +++ b/modules/home/programs/graphical/bars/waybar/modules/default-modules.nix @@ -1,8 +1,13 @@ -{ lib, pkgs, ... }: +{ + lib, + pkgs, + root, + ... +}: let inherit (lib) getExe getExe'; - catppuccin = import (lib.snowfall.fs.get-file "modules/home/theme/catppuccin/colors.nix"); + catppuccin = import (root + "/modules/home/theme/catppuccin/colors.nix"); in { backlight = diff --git a/modules/home/programs/graphical/bars/waybar/modules/group-modules.nix b/modules/home/programs/graphical/bars/waybar/modules/group-modules.nix index f1c93036f..6e8b85669 100644 --- a/modules/home/programs/graphical/bars/waybar/modules/group-modules.nix +++ b/modules/home/programs/graphical/bars/waybar/modules/group-modules.nix @@ -1,6 +1,6 @@ { lib, - namespace, + osConfig, ... }: @@ -42,7 +42,7 @@ "systemd-failed-units" "custom/notification" ] - ++ lib.optionals osConfig.${namespace}.security.sops.enable [ "custom/github" ] + ++ lib.optionals osConfig.khanelinix.security.sops.enable [ "custom/github" ] ++ [ "bluetooth" "group/audio" diff --git a/modules/home/programs/graphical/browsers/chromium/default.nix b/modules/home/programs/graphical/browsers/chromium/default.nix index 17ffeaf75..a3258d6f3 100644 --- a/modules/home/programs/graphical/browsers/chromium/default.nix +++ b/modules/home/programs/graphical/browsers/chromium/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.browsers.chromium; + cfg = config.khanelinix.programs.graphical.browsers.chromium; in { - options.${namespace}.programs.graphical.browsers.chromium = { + options.khanelinix.programs.graphical.browsers.chromium = { enable = mkBoolOpt false "Whether or not to enable chromium."; }; diff --git a/modules/home/programs/graphical/browsers/firefox/default.nix b/modules/home/programs/graphical/browsers/firefox/default.nix index 0eebd54c9..2554e7cc6 100644 --- a/modules/home/programs/graphical/browsers/firefox/default.nix +++ b/modules/home/programs/graphical/browsers/firefox/default.nix @@ -1,8 +1,9 @@ { config, + inputs, lib, pkgs, - namespace, + khanelinix-lib, ... }: let @@ -12,18 +13,20 @@ let mkMerge optionalAttrs ; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.programs.graphical.browsers.firefox; + cfg = config.khanelinix.programs.graphical.browsers.firefox; firefoxPath = if pkgs.stdenv.isLinux then - ".mozilla/firefox/${config.${namespace}.user.name}" + ".mozilla/firefox/${config.khanelinix.user.name}" else - "/Users/${config.${namespace}.user.name}/Library/Application Support/Firefox/Profiles/${config.${namespace}.user.name}"; + "/Users/${config.khanelinix.user.name}/Library/Application Support/Firefox/Profiles/${config.khanelinix.user.name}"; in { - options.${namespace}.programs.graphical.browsers.firefox = with types; { + imports = lib.optional (inputs.nur ? hmModules) inputs.nur.hmModules.sops; + + options.khanelinix.programs.graphical.browsers.firefox = with types; { enable = mkBoolOpt false "Whether or not to enable Firefox."; extensions = @@ -214,12 +217,12 @@ in profiles = { "dev-edition-default" = { id = 0; - path = "${config.${namespace}.user.name}"; + path = "${config.khanelinix.user.name}"; }; - ${config.${namespace}.user.name} = { + ${config.khanelinix.user.name} = { inherit (cfg) extraConfig extensions search; - inherit (config.${namespace}.user) name; + inherit (config.khanelinix.user) name; id = 1; diff --git a/modules/home/programs/graphical/editors/vscode/default.nix b/modules/home/programs/graphical/editors/vscode/default.nix index 6f26aaf8f..d09fc6bb2 100644 --- a/modules/home/programs/graphical/editors/vscode/default.nix +++ b/modules/home/programs/graphical/editors/vscode/default.nix @@ -1,26 +1,27 @@ { config, + khanelinix-lib, lib, - pkgs, - namespace, osConfig, + pkgs, + root, ... }: let inherit (lib) mkEnableOption mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.editors.vscode; + cfg = config.khanelinix.programs.graphical.editors.vscode; in { - options.${namespace}.programs.graphical.editors.vscode = { + options.khanelinix.programs.graphical.editors.vscode = { enable = mkEnableOption "Whether or not to enable vscode."; declarativeConfig = mkBoolOpt false "Whether or not to enable vscode."; }; config = mkIf cfg.enable { home.file = { - ".vscode/argv.json" = mkIf config.${namespace}.services.keyring.enable { + ".vscode/argv.json" = mkIf config.khanelinix.services.keyring.enable { text = builtins.toJSON { "enable-crash-reporter" = true; "crash-reporter-id" = "53a6c113-87c4-4f20-9451-dd67057ddb95"; @@ -200,9 +201,9 @@ in }; }; - sops.secrets = lib.mkIf osConfig.${namespace}.security.sops.enable { + sops.secrets = lib.mkIf osConfig.khanelinix.security.sops.enable { wakatime = { - sopsFile = lib.snowfall.fs.get-file "secrets/khaneliman/default.yaml"; + sopsFile = root + "/secrets/khaneliman/default.yaml"; path = "${config.home.homeDirectory}/.wakatime.cfg"; }; }; diff --git a/modules/home/programs/graphical/launchers/anyrun/default.nix b/modules/home/programs/graphical/launchers/anyrun/default.nix index 094831cf0..461b0f6e3 100644 --- a/modules/home/programs/graphical/launchers/anyrun/default.nix +++ b/modules/home/programs/graphical/launchers/anyrun/default.nix @@ -1,29 +1,32 @@ { config, inputs, + khanelinix-lib, lib, - namespace, system, osConfig, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; - inherit (inputs) anyrun anyrun-nixos-options; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.launchers.anyrun; + cfg = config.khanelinix.programs.graphical.launchers.anyrun; in { - options.${namespace}.programs.graphical.launchers.anyrun = { + imports = lib.optional ( + inputs.anyrun ? homeManagerModules + ) inputs.anyrun.homeManagerModules.default; + + options.khanelinix.programs.graphical.launchers.anyrun = { enable = mkBoolOpt false "Whether to enable anyrun in the desktop environment."; }; - config = mkIf cfg.enable { + config = mkIf (cfg.enable && (inputs.anyrun ? homeManagerModules)) { programs.anyrun = { enable = true; config = { - plugins = with anyrun.packages.${system}; [ + plugins = with inputs.anyrun.packages.${system}; [ applications dictionary rink diff --git a/modules/home/programs/graphical/launchers/rofi/default.nix b/modules/home/programs/graphical/launchers/rofi/default.nix index 20e99b883..7279f9086 100644 --- a/modules/home/programs/graphical/launchers/rofi/default.nix +++ b/modules/home/programs/graphical/launchers/rofi/default.nix @@ -1,18 +1,18 @@ { config, + khanelinix-lib, lib, pkgs, - namespace, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.launchers.rofi; + cfg = config.khanelinix.programs.graphical.launchers.rofi; in { - options.${namespace}.programs.graphical.launchers.rofi = { + options.khanelinix.programs.graphical.launchers.rofi = { enable = mkBoolOpt false "Whether to enable Rofi in the desktop environment."; }; diff --git a/modules/home/programs/graphical/launchers/wofi/default.nix b/modules/home/programs/graphical/launchers/wofi/default.nix index 5cf4bbb2e..88e66377e 100644 --- a/modules/home/programs/graphical/launchers/wofi/default.nix +++ b/modules/home/programs/graphical/launchers/wofi/default.nix @@ -1,18 +1,18 @@ { config, + khanelinix-lib, lib, pkgs, - namespace, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.addons.wofi; + cfg = config.khanelinix.programs.graphical.addons.wofi; in { - options.${namespace}.programs.graphical.addons.wofi = { + options.khanelinix.programs.graphical.addons.wofi = { enable = mkBoolOpt false "Whether to enable the Wofi in the desktop environment."; }; diff --git a/modules/home/programs/graphical/screenlockers/hyprlock/default.nix b/modules/home/programs/graphical/screenlockers/hyprlock/default.nix index 0b394829b..f2c9d6397 100644 --- a/modules/home/programs/graphical/screenlockers/hyprlock/default.nix +++ b/modules/home/programs/graphical/screenlockers/hyprlock/default.nix @@ -1,20 +1,21 @@ { config, + khanelinix-lib, lib, osConfig, - namespace, + root, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - catppuccin = import (lib.snowfall.fs.get-file "modules/home/theme/catppuccin/colors.nix"); + catppuccin = import (root + "/modules/home/theme/catppuccin/colors.nix"); - cfg = config.${namespace}.programs.graphical.screenlockers.hyprlock; + cfg = config.khanelinix.programs.graphical.screenlockers.hyprlock; in { - options.${namespace}.programs.graphical.screenlockers.hyprlock = { + options.khanelinix.programs.graphical.screenlockers.hyprlock = { enable = mkBoolOpt false "Whether to enable hyprlock in the desktop environment."; }; @@ -106,7 +107,7 @@ in text = "$TIME"; color = catppuccin.colors.text.rgb; font_size = 100; - font_family = osConfig.${namespace}.system.fonts.default; + font_family = osConfig.khanelinix.system.fonts.default; valign = "center"; halign = "center"; position = "0, 330"; @@ -121,7 +122,7 @@ in text = " $USER"; color = catppuccin.colors.text.rgb; font_size = 25; - font_family = osConfig.${namespace}.system.fonts.default; + font_family = osConfig.khanelinix.system.fonts.default; valign = "top"; halign = "left"; position = "10, 0"; @@ -136,7 +137,7 @@ in text = "󰌾 "; color = catppuccin.colors.text.rgb; font_size = 50; - font_family = osConfig.${namespace}.system.fonts.default; + font_family = osConfig.khanelinix.system.fonts.default; valign = "center"; halign = "center"; position = "15, -350"; @@ -151,7 +152,7 @@ in text = "Locked"; color = catppuccin.colors.text.rgb; font_size = 25; - font_family = osConfig.${namespace}.system.fonts.default; + font_family = osConfig.khanelinix.system.fonts.default; valign = "center"; halign = "center"; position = "0, -430"; @@ -166,7 +167,7 @@ in text = "cmd[update:120000] echo \"$(date +'%a %d %B')\""; color = catppuccin.colors.text.rgb; font_size = 30; - font_family = osConfig.${namespace}.system.fonts.default; + font_family = osConfig.khanelinix.system.fonts.default; valign = "center"; halign = "center"; position = "0, 210"; @@ -181,7 +182,7 @@ in text = " "; color = catppuccin.colors.text.rgb; font_size = 25; - font_family = osConfig.${namespace}.system.fonts.default; + font_family = osConfig.khanelinix.system.fonts.default; valign = "bottom"; halign = "right"; position = "5, 8"; diff --git a/modules/home/programs/graphical/screenlockers/swaylock/default.nix b/modules/home/programs/graphical/screenlockers/swaylock/default.nix index 8177ebfc0..f436cad3d 100644 --- a/modules/home/programs/graphical/screenlockers/swaylock/default.nix +++ b/modules/home/programs/graphical/screenlockers/swaylock/default.nix @@ -1,18 +1,20 @@ { config, + khanelinix-lib, lib, pkgs, - namespace, + self, + system, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.screenlockers.swaylock; + cfg = config.khanelinix.programs.graphical.screenlockers.swaylock; in { - options.${namespace}.programs.graphical.screenlockers.swaylock = { + options.khanelinix.programs.graphical.screenlockers.swaylock = { enable = mkBoolOpt false "Whether to enable swaylock in the desktop environment."; }; @@ -31,7 +33,7 @@ in timestr = "%R"; datestr = "%a, %e of %B"; - image = "${pkgs.${namespace}.wallpapers}/share/wallpapers/flatppuccin_macchiato.png"; + image = "${self.packages.${system}.wallpapers}/share/wallpapers/flatppuccin_macchiato.png"; fade-in = "0.2"; diff --git a/modules/home/programs/graphical/wms/hyprland/apps.nix b/modules/home/programs/graphical/wms/hyprland/apps.nix index e3430c92b..884324d10 100644 --- a/modules/home/programs/graphical/wms/hyprland/apps.nix +++ b/modules/home/programs/graphical/wms/hyprland/apps.nix @@ -2,13 +2,13 @@ config, lib, pkgs, - namespace, + ... }: let inherit (lib) mkIf getExe; - cfg = config.${namespace}.programs.graphical.wms.hyprland; + cfg = config.khanelinix.programs.graphical.wms.hyprland; in { config = mkIf cfg.enable { diff --git a/modules/home/programs/graphical/wms/hyprland/binds.nix b/modules/home/programs/graphical/wms/hyprland/binds.nix index 5d81bb70d..89152dff4 100644 --- a/modules/home/programs/graphical/wms/hyprland/binds.nix +++ b/modules/home/programs/graphical/wms/hyprland/binds.nix @@ -2,13 +2,13 @@ config, lib, pkgs, - namespace, + ... }: let inherit (lib) mkIf getExe; - cfg = config.${namespace}.programs.graphical.wms.hyprland; + cfg = config.khanelinix.programs.graphical.wms.hyprland; in { config = mkIf cfg.enable { diff --git a/modules/home/programs/graphical/wms/hyprland/default.nix b/modules/home/programs/graphical/wms/hyprland/default.nix index a0c5d3ae1..d0940a228 100644 --- a/modules/home/programs/graphical/wms/hyprland/default.nix +++ b/modules/home/programs/graphical/wms/hyprland/default.nix @@ -1,18 +1,18 @@ { config, inputs, + khanelinix-lib, lib, pkgs, system, - namespace, ... }: let inherit (lib) mkIf mkEnableOption getExe; - inherit (lib.${namespace}) enabled; + inherit (khanelinix-lib) enabled; inherit (inputs) hyprland; - cfg = config.${namespace}.programs.graphical.wms.hyprland; + cfg = config.khanelinix.programs.graphical.wms.hyprland; historicalLogAliases = builtins.listToAttrs ( builtins.genList (x: { @@ -24,12 +24,12 @@ let historicalCrashAliases = builtins.listToAttrs ( builtins.genList (x: { name = "hlc${toString (x + 1)}"; - value = "cat /home/${config.${namespace}.user.name}/.local/cache/hyprland/$(command ls -t /home/${config.${namespace}.user.name}/.local/cache/hyprland/ | grep 'hyprlandCrashReport' | head -n ${toString (x + 2)} | tail -n 1)"; + value = "cat /home/${config.khanelinix.user.name}/.local/cache/hyprland/$(command ls -t /home/${config.khanelinix.user.name}/.local/cache/hyprland/ | grep 'hyprlandCrashReport' | head -n ${toString (x + 2)} | tail -n 1)"; }) 4 ); in { - options.${namespace}.programs.graphical.wms.hyprland = { + options.khanelinix.programs.graphical.wms.hyprland = { enable = mkEnableOption "Hyprland."; enableDebug = mkEnableOption "Enable debug mode."; appendConfig = lib.mkOption { @@ -63,8 +63,8 @@ in { CLUTTER_BACKEND = "wayland"; GDK_BACKEND = "wayland,x11"; - HYPRCURSOR_THEME = config.${namespace}.theme.gtk.cursor.name; - HYPRCURSOR_SIZE = "${toString config.${namespace}.theme.cursor.size}"; + HYPRCURSOR_THEME = config.khanelinix.theme.gtk.cursor.name; + HYPRCURSOR_SIZE = "${toString config.khanelinix.theme.cursor.size}"; MOZ_ENABLE_WAYLAND = "1"; MOZ_USE_XINPUT2 = "1"; # NOTE: causes gldriverquery crash on wayland @@ -84,7 +84,7 @@ in shellAliases = { hl = "cat $XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/hyprland${lib.optionalString cfg.enableDebug "d"}.log"; - hlc = "cat /home/${config.${namespace}.user.name}/.local/cache/hyprland/$(command ls -t /home/${config.${namespace}.user.name}/.local/cache/hyprland/ | grep 'hyprlandCrashReport' | head -n 1)"; + hlc = "cat /home/${config.khanelinix.user.name}/.local/cache/hyprland/$(command ls -t /home/${config.khanelinix.user.name}/.local/cache/hyprland/ | grep 'hyprlandCrashReport' | head -n 1)"; } // historicalLogAliases // historicalCrashAliases; diff --git a/modules/home/programs/graphical/wms/hyprland/variables.nix b/modules/home/programs/graphical/wms/hyprland/variables.nix index e1e06f335..8e01c0e75 100644 --- a/modules/home/programs/graphical/wms/hyprland/variables.nix +++ b/modules/home/programs/graphical/wms/hyprland/variables.nix @@ -2,7 +2,7 @@ config, lib, pkgs, - namespace, + ... }: let @@ -20,9 +20,9 @@ let '' ); - screenshot-path = "/home/${config.${namespace}.user.name}/Pictures/screenshots"; + screenshot-path = "/home/${config.khanelinix.user.name}/Pictures/screenshots"; - cfg = config.${namespace}.programs.graphical.wms.hyprland; + cfg = config.khanelinix.programs.graphical.wms.hyprland; in { config = mkIf cfg.enable { @@ -197,12 +197,12 @@ in "$looking-glass" = "${getExe pkgs.looking-glass-client}"; "$screen-locker" = "${getExe config.programs.hyprlock.package}"; "$window-inspector" = "${getExe pkgs.hyprprop}"; - "$screen-recorder" = "${getExe pkgs.${namespace}.record_screen}"; + "$screen-recorder" = "${getExe self.packages.${system}.record_screen}"; "$bar" = ".waybar-wrapped"; # screenshot commands "$notify-screenshot" = ''${getExe pkgs.libnotify} --icon "$file" "Screenshot Saved"''; - "$screenshot-path" = "/home/${config.${namespace}.user.name}/Pictures/screenshots"; + "$screenshot-path" = "/home/${config.khanelinix.user.name}/Pictures/screenshots"; "$grimblast_area_file" = ''file="${screenshot-path}/$(${getDateTime}).png" && ${grimblast} --freeze --notify save area "$file"''; "$grimblast_active_file" = diff --git a/modules/home/programs/graphical/wms/hyprland/windowrules.nix b/modules/home/programs/graphical/wms/hyprland/windowrules.nix new file mode 100644 index 000000000..236d3be32 --- /dev/null +++ b/modules/home/programs/graphical/wms/hyprland/windowrules.nix @@ -0,0 +1,190 @@ +{ + config, + lib, + + ... +}: +let + inherit (lib) mkIf; + cfg = config.khanelinix.programs.graphical.wms.hyprland; +in +{ + config = mkIf cfg.enable { + wayland.windowManager.hyprland = { + settings = { + windowrulev2 = [ + # ░█░█░▀█▀░█▀█░█▀▄░█▀█░█░█░░░█▀▄░█░█░█░░░█▀▀░█▀▀ + # ░█▄█░░█░░█░█░█░█░█░█░█▄█░░░█▀▄░█░█░█░░░█▀▀░▀▀█ + # ░▀░▀░▀▀▀░▀░▀░▀▀░░▀▀▀░▀░▀░░░▀░▀░▀▀▀░▀▀▀░▀▀▀░▀▀▀ + # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + + ## + # ░█▀▀░█░░░█▀█░█▀█░▀█▀░▀█▀░█▀█░█▀▀ + # ░█▀▀░█░░░█░█░█▀█░░█░░░█░░█░█░█░█ + # ░▀░░░▀▀▀░▀▀▀░▀░▀░░▀░░▀▀▀░▀░▀░▀▀▀ + ## + "float, class:Rofi" + "float, class:viewnior" + "float, class:feh" + "float, class:wlogout" + "float, class:file_progress" + "float, class:confirm" + "float, class:dialog" + "float, class:download" + "float, class:notification" + "float, class:error" + "float, class:splash" + "float, class:confirmreset" + "float, class:org.kde.polkit-kde-authentication-agent-1" + "float, class:^(wdisplays)$" + "size 1100 600, class:^(wdisplays)$" + "float, class:^(blueman-manager)$" + "float, class:^(nm-connection-editor)$" + "float, class:it.mijorus.smile" + + # floating terminal + "float, title:^(floatterm)$" + "size 1100 600, title:^(floatterm)$" + "move center, title:^(floatterm)$" + "animation slide, title:^(floatterm)$" + + # calendar reminders + "float, class:^(thunderbird)$,title:.*(Reminders)$" + "size 1100 600, class:^(thunderbird)$,title:.*(Reminders)$" + "move 78% 6%, class:^(thunderbird)$,title:.*(Reminders)$" + "pin, class:^(thunderbird)$,title:.*(Reminders)$" + + # thunar file operation progress + "float, class:^(thunar)$,title:^(File Operation Progress)$" + "size 800 600, class:^(thunar)$,title:^(File Operation Progress)$" + "move 78% 6%, class:^(thunar)$,title:^(File Operation Progress)$" + "pin, class:^(thunar)$,title:^(File Operation Progress)$" + + "minsize 5120 1440, class:^(steam_app_0)$, title:^(World of Warcraft)$" + "center, class:^(steam_app_0)$, title:^(World of Warcraft)$" + "fullscreen, class:^(steam_app_0)$, title:^(World of Warcraft)$" + + # Workspace 8 (VM) layout + "size 1000 1330, class:^(virt-manager)$, title:^(Virtual Machine Manager)$" + "float, class:^(virt-manager)$, title:^(Virtual Machine Manager)$" + "move 80% 6%, class:^(virt-manager)$, title:^(Virtual Machine Manager)$" + "float, class:^(looking-glass-client)$" + "size 2360 1330, class:^(looking-glass-client)$" + "move 25% 6%, class:^(looking-glass-client)$" + "float, class:^(virt-manager)$, title:^.*(on QEMU/KVM)$" + "size 2360 1330, class:^(virt-manager)$, title:^.*(on QEMU/KVM)$" + "move 25% 6%, class:^(virt-manager)$, title:^.*(on QEMU/KVM)$" + "float, class:^(qemu)$" + "size 2360 1330, class:^(qemu)$" + "move 25% 6%, class:^(qemu)$" + + # make Firefox PiP window floating and sticky + "float, title:^(Picture-in-Picture)$" + "pin, title:^(Picture-in-Picture)$" + + # fix xwayland apps + "rounding 0, xwayland:1, floating:1" + "center, class:^(.*jetbrains.*)$, title:^(Confirm Exit|Open Project|win424|win201|splash)$" + "size 640 400, class:^(.*jetbrains.*)$, title:^(splash)$" + + ## + # ░█▀█░█▀█░█▀█░█▀▀░▀█▀░▀█▀░█░█ + # ░█░█░█▀▀░█▀█░█░░░░█░░░█░░░█░ + # ░▀▀▀░▀░░░▀░▀░▀▀▀░▀▀▀░░▀░░░▀░ + ## + "opaque, class:^(virt-manager)$,title:.*(on QEMU).*" + "opaque, class:^(looking-glass-client)$" + "opaque, title:^(.*(Twitch|TNTdrama|YouTube|Bally Sports|Video Entertainment|Plex)).*(Firefox).*$" + "dimaround, class:^(gcr-prompter)$" + + # Require input + "bordercolor rgba(ed8796FF), class:org.kde.polkit-kde-authentication-agent-1" + "dimaround, class:org.kde.polkit-kde-authentication-agent-1" + "stayfocused, class:org.kde.polkit-kde-authentication-agent-1" + "stayfocused, class:Rofi" + "nofocus, class:^(steam)$, title:^()$" + "nofocus, class:^(xwaylandvideobridge)$" + "stayfocused, class:it.mijorus.smile" + + ## + # ░▀█▀░█▀▄░█░░░█▀▀░▀█▀░█▀█░█░█░▀█▀░█▀▄░▀█▀░▀█▀ + # ░░█░░█░█░█░░░█▀▀░░█░░█░█░█▀█░░█░░█▀▄░░█░░░█░ + # ░▀▀▀░▀▀░░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀░▀░▀▀▀░▀▀░░▀▀▀░░▀░ + ## + "idleinhibit focus, class:^(steam_app).*" + "idleinhibit focus, class:^(gamescope).*" + "idleinhibit focus, class:.*(cemu|yuzu|Ryujinx|emulationstation|retroarch).*" + "idleinhibit fullscreen, title:.*(cemu|yuzu|Ryujinx|emulationstation|retroarch).*" + "idleinhibit fullscreen, title:^(.*(Twitch|TNTdrama|YouTube|Bally Sports|Video Entertainment|Plex)).*(Firefox).*$" + "idleinhibit focus, title:^(.*(Twitch|TNTdrama|YouTube|Bally Sports|Video Entertainment|Plex)).*(Firefox).*$" + "idleinhibit focus, class:^(mpv|.+exe)$" + + ## + # ░▀█▀░█▀▀░█▀█░█▀▄░▀█▀░█▀█░█▀▀ + # ░░█░░█▀▀░█▀█░█▀▄░░█░░█░█░█░█ + # ░░▀░░▀▀▀░▀░▀░▀░▀░▀▀▀░▀░▀░▀▀▀ + ## + "immediate, class:^(gamescope|steam_app).*" + + # xwaylandvideobridge + "opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$" + "noanim,class:^(xwaylandvideobridge)$" + "noinitialfocus,class:^(xwaylandvideobridge)$" + "maxsize 1 1,class:^(xwaylandvideobridge)$" + "noblur,class:^(xwaylandvideobridge)$" + + ## + # ░█░█░█▀█░█▀▄░█░█░█▀▀░█▀█░█▀█░█▀▀░█▀▀░░░█▀▀░█▀█░█▀█░█▀▀░▀█▀░█▀▀ + # ░█▄█░█░█░█▀▄░█▀▄░▀▀█░█▀▀░█▀█░█░░░█▀▀░░░█░░░█░█░█░█░█▀▀░░█░░█░█ + # ░▀░▀░▀▀▀░▀░▀░▀░▀░▀▀▀░▀░░░▀░▀░▀▀▀░▀▀▀░░░▀▀▀░▀▀▀░▀░▀░▀░░░▀▀▀░▀▀▀ + ## + + # Secondary Monitor Media + "workspace 1, title:^(.*(Twitch|TNTdrama|YouTube|Bally Sports|Video Entertainment|Plex)).*(Firefox).*$" # TODO: Doesnt seem to work even though it says it matches + #Browsers + "workspace 2, title:^(?!.*(Twitch|TNTdrama|YouTube|Bally Sports|Video Entertainment|Plex)).*(Firefox).*$" + "workspace special:inactive, title:^(.*(hidden tabs - Workona)).*(Firefox).*$" # TODO: Doesnt seem to work even though it says it matches + # Code + "workspace 3, class:^(Code)$" + "workspace 3, class:^(neovide)$" + "workspace 3, class:^(GitHub Desktop)$" + "workspace 3, class:^(GitKraken)$" + # Gaming + "workspace 4 silent, class:^(Steam|steam)$" + "workspace 4 silent, class:^(Steam|steam)., title:^(Steam|steam)$" + "workspace 4 silent, class:^(gamescope|steam_app).*" + "workspace 4, class:^(heroic)$" + "workspace 4, class:^(lutris)$" + "workspace 4, class:^(steam_app_0)., title:^(Battle.net)$" + "workspace 4, class:^(steam_app_0)., title:^(World of Warcraft)$" + "workspace 4, class:^(org.vinegarhq.Sober)$" + "workspace 4, class:.*(cemu|yuzu|Ryujinx|emulationstation|retroarch).*" + "workspace 4, title:.*(cemu|yuzu|Ryujinx|emulationstation|retroarch).*" + # Messaging + "workspace 5 silent, class:^(Slack)$" + "workspace 5 silent, class:^(Caprine)$" + "workspace 5 silent, class:^(org.telegram.desktop)$" + "workspace 5 silent, class:^(discord)$" + "workspace 5 silent, class:^(zoom)$" + "workspace 5 silent, class:^(Element)$" + "workspace 5 silent, class:^(teams-for-linux)$" + # Mail + "workspace 6 silent, class:^(thunderbird)$" + "workspace 6 silent, class:^(Mailspring)$" + # Media + "workspace 7, class:^(mpv|vlc|mpdevil)$" + "workspace 7 silent, class:^(Spotify)$" + "workspace 7 silent, title:^(Spotify)$" + "workspace 7 silent, title:^(Spotify Free)$" + "tile, class:^(Spotify)$" + "tile, class:^(Spotify Free)$" + "workspace 7 silent, class:^(elisa)$" + #Remote + "workspace 8 silent, class:^(virt-manager|qemu)$" + "workspace 8 silent, class:^(gnome-connections)$" + "workspace 8, class:^(looking-glass-client)$" + ]; + }; + }; + }; +} diff --git a/modules/home/programs/graphical/wms/hyprland/workspacerules.nix b/modules/home/programs/graphical/wms/hyprland/workspacerules.nix index 39ce73831..fcd856d17 100644 --- a/modules/home/programs/graphical/wms/hyprland/workspacerules.nix +++ b/modules/home/programs/graphical/wms/hyprland/workspacerules.nix @@ -1,12 +1,12 @@ { config, lib, - namespace, + ... }: let inherit (lib) mkIf; - cfg = config.${namespace}.programs.graphical.wms.hyprland; + cfg = config.khanelinix.programs.graphical.wms.hyprland; in { config = mkIf cfg.enable { diff --git a/modules/home/programs/graphical/wms/sway/apps.nix b/modules/home/programs/graphical/wms/sway/apps.nix index bc0ba7650..51890d6ed 100644 --- a/modules/home/programs/graphical/wms/sway/apps.nix +++ b/modules/home/programs/graphical/wms/sway/apps.nix @@ -2,13 +2,13 @@ config, lib, pkgs, - namespace, + ... }: let inherit (lib) mkIf getExe; - cfg = config.${namespace}.programs.graphical.wms.sway; + cfg = config.khanelinix.programs.graphical.wms.sway; in { config = mkIf cfg.enable { diff --git a/modules/home/programs/graphical/wms/sway/binds.nix b/modules/home/programs/graphical/wms/sway/binds.nix index 0e7ad5ff8..4d32b2440 100644 --- a/modules/home/programs/graphical/wms/sway/binds.nix +++ b/modules/home/programs/graphical/wms/sway/binds.nix @@ -1,7 +1,7 @@ { config, lib, - namespace, + pkgs, ... }: @@ -13,7 +13,7 @@ let mkForce ; - cfg = config.${namespace}.programs.graphical.wms.sway; + cfg = config.khanelinix.programs.graphical.wms.sway; in { config = mkIf cfg.enable { @@ -35,7 +35,7 @@ in '' ); - screenshot-path = "/home/${config.${namespace}.user.name}/Pictures/screenshots"; + screenshot-path = "/home/${config.khanelinix.user.name}/Pictures/screenshots"; browser = "${getExe config.programs.firefox.package}"; explorer = "${getExe pkgs.xfce.thunar}"; notification_center = "${getExe' config.services.swaync.package "swaync-client"}"; @@ -43,7 +43,7 @@ in looking-glass = "${getExe pkgs.looking-glass-client}"; screen-locker = "${getExe config.programs.swaylock.package}"; # window-inspector = "${getExe pkgs.hyprprop}"; - screen-recorder = "${getExe pkgs.${namespace}.record_screen}"; + screen-recorder = "${getExe self.packages.${system}.record_screen}"; # screenshot commands grimblast_area_file = ''file="${screenshot-path}/$(${getDateTime}).png" && ${grimblast} --freeze --notify save area "$file"''; diff --git a/modules/home/programs/graphical/wms/sway/default.nix b/modules/home/programs/graphical/wms/sway/default.nix index 113101421..d2997d314 100644 --- a/modules/home/programs/graphical/wms/sway/default.nix +++ b/modules/home/programs/graphical/wms/sway/default.nix @@ -2,18 +2,18 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf mkEnableOption getExe; - inherit (lib.${namespace}) enabled; + inherit (khanelinix-lib) enabled; - cfg = config.${namespace}.programs.graphical.wms.sway; + cfg = config.khanelinix.programs.graphical.wms.sway; in { - options.${namespace}.programs.graphical.wms.sway = { + options.khanelinix.programs.graphical.wms.sway = { enable = mkEnableOption "sway."; enableDebug = mkEnableOption "Enable debug mode."; appendConfig = lib.mkOption { diff --git a/modules/home/programs/graphical/wms/sway/windowrules.nix b/modules/home/programs/graphical/wms/sway/windowrules.nix index 8c70cad11..2fc17b344 100644 --- a/modules/home/programs/graphical/wms/sway/windowrules.nix +++ b/modules/home/programs/graphical/wms/sway/windowrules.nix @@ -1,12 +1,12 @@ { config, lib, - namespace, + ... }: let inherit (lib) mkIf; - cfg = config.${namespace}.programs.graphical.wms.sway; + cfg = config.khanelinix.programs.graphical.wms.sway; in { config = mkIf cfg.enable { diff --git a/modules/home/programs/terminal/editors/helix/default.nix b/modules/home/programs/terminal/editors/helix/default.nix index 95ee3ffc3..73e235298 100644 --- a/modules/home/programs/terminal/editors/helix/default.nix +++ b/modules/home/programs/terminal/editors/helix/default.nix @@ -2,18 +2,18 @@ config, lib, pkgs, - namespace, + ... }: let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.programs.terminal.editors.helix; + cfg = config.khanelinix.programs.terminal.editors.helix; in { imports = lib.snowfall.fs.get-non-default-nix-files ./.; - options.${namespace}.programs.terminal.editors.helix = { + options.khanelinix.programs.terminal.editors.helix = { enable = mkEnableOption "Helix"; }; diff --git a/modules/home/programs/terminal/editors/micro/default.nix b/modules/home/programs/terminal/editors/micro/default.nix index 63decc2d6..c9ed164f5 100644 --- a/modules/home/programs/terminal/editors/micro/default.nix +++ b/modules/home/programs/terminal/editors/micro/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.editors.micro; + cfg = config.khanelinix.programs.terminal.editors.micro; in { - options.${namespace}.programs.terminal.editors.micro = { + options.khanelinix.programs.terminal.editors.micro = { enable = mkBoolOpt false "Whether or not to enable micro."; default = mkBoolOpt false "Whether to set micro as the session EDITOR"; }; diff --git a/modules/home/programs/terminal/editors/neovim/default.nix b/modules/home/programs/terminal/editors/neovim/default.nix index fd54787ed..99598f9a3 100644 --- a/modules/home/programs/terminal/editors/neovim/default.nix +++ b/modules/home/programs/terminal/editors/neovim/default.nix @@ -1,15 +1,16 @@ { config, inputs, + khanelinix-lib, lib, - namespace, osConfig, pkgs, + root, system, ... }: let - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; khanelivimConfiguration = inputs.khanelivim.nixvimConfigurations.${system}.khanelivim; khanelivimConfigurationExtended = khanelivimConfiguration.extendModules { @@ -28,10 +29,10 @@ let }; khanelivim = khanelivimConfigurationExtended.config.build.package; - cfg = config.${namespace}.programs.terminal.editors.neovim; + cfg = config.khanelinix.programs.terminal.editors.neovim; in { - options.${namespace}.programs.terminal.editors.neovim = { + options.khanelinix.programs.terminal.editors.neovim = { enable = lib.mkEnableOption "neovim"; default = mkBoolOpt true "Whether to set Neovim as the session EDITOR"; }; @@ -47,9 +48,9 @@ in ]; }; - sops.secrets = lib.mkIf osConfig.${namespace}.security.sops.enable { + sops.secrets = lib.mkIf osConfig.khanelinix.security.sops.enable { wakatime = { - sopsFile = lib.snowfall.fs.get-file "secrets/khaneliman/default.yaml"; + sopsFile = root + "/secrets/khaneliman/default.yaml"; path = "${config.home.homeDirectory}/.wakatime.cfg"; }; }; diff --git a/modules/home/programs/terminal/emulators/alacritty/default.nix b/modules/home/programs/terminal/emulators/alacritty/default.nix index 035e071e6..ee33f6410 100644 --- a/modules/home/programs/terminal/emulators/alacritty/default.nix +++ b/modules/home/programs/terminal/emulators/alacritty/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) types mkIf; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.programs.terminal.emulators.alacritty; + cfg = config.khanelinix.programs.terminal.emulators.alacritty; in { - options.${namespace}.programs.terminal.emulators.alacritty = with types; { + options.khanelinix.programs.terminal.emulators.alacritty = with types; { enable = mkBoolOpt false "Whether to enable alacritty."; font = { normal = mkOpt str "MonaspiceNe Nerd Font" "Font to use for alacritty."; diff --git a/modules/home/programs/terminal/emulators/foot/default.nix b/modules/home/programs/terminal/emulators/foot/default.nix index d7e5f47ab..5edfe396e 100644 --- a/modules/home/programs/terminal/emulators/foot/default.nix +++ b/modules/home/programs/terminal/emulators/foot/default.nix @@ -2,17 +2,17 @@ config, pkgs, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.emulators.foot; + cfg = config.khanelinix.programs.terminal.emulators.foot; in { - options.${namespace}.programs.terminal.emulators.foot = { + options.khanelinix.programs.terminal.emulators.foot = { enable = mkBoolOpt false "Whether or not to enable foot."; }; diff --git a/modules/home/programs/terminal/emulators/kitty/default.nix b/modules/home/programs/terminal/emulators/kitty/default.nix index 341538e75..96bebfcfa 100644 --- a/modules/home/programs/terminal/emulators/kitty/default.nix +++ b/modules/home/programs/terminal/emulators/kitty/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) types mkIf; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.programs.terminal.emulators.kitty; + cfg = config.khanelinix.programs.terminal.emulators.kitty; in { - options.${namespace}.programs.terminal.emulators.kitty = with types; { + options.khanelinix.programs.terminal.emulators.kitty = with types; { enable = mkBoolOpt false "Whether to enable kitty."; font = { normal = mkOpt str "MonaspiceNe Nerd Font" "Font to use for alacritty."; diff --git a/modules/home/programs/terminal/emulators/warp/default.nix b/modules/home/programs/terminal/emulators/warp/default.nix index 3ba112f91..e03350a29 100644 --- a/modules/home/programs/terminal/emulators/warp/default.nix +++ b/modules/home/programs/terminal/emulators/warp/default.nix @@ -2,18 +2,18 @@ config, pkgs, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.emulators.warp; + cfg = config.khanelinix.programs.terminal.emulators.warp; in { - options.${namespace}.programs.terminal.emulators.warp = { + options.khanelinix.programs.terminal.emulators.warp = { enable = mkBoolOpt false "Whether or not to enable warp."; }; diff --git a/modules/home/programs/terminal/emulators/wezterm/default.nix b/modules/home/programs/terminal/emulators/wezterm/default.nix index d469b44d5..8e595af20 100644 --- a/modules/home/programs/terminal/emulators/wezterm/default.nix +++ b/modules/home/programs/terminal/emulators/wezterm/default.nix @@ -3,19 +3,20 @@ inputs, lib, system, - namespace, + khanelinix-lib, + root, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; inherit (inputs) wezterm; - cfg = config.${namespace}.programs.terminal.emulators.wezterm; - catppuccin = import (lib.snowfall.fs.get-file "modules/home/theme/catppuccin/colors.nix"); + cfg = config.khanelinix.programs.terminal.emulators.wezterm; + catppuccin = import (root + "/modules/home/theme/catppuccin/colors.nix"); in { - options.${namespace}.programs.terminal.emulators.wezterm = { + options.khanelinix.programs.terminal.emulators.wezterm = { enable = mkBoolOpt false "Whether or not to enable wezterm."; }; diff --git a/modules/home/programs/terminal/media/ncmpcpp/default.nix b/modules/home/programs/terminal/media/ncmpcpp/default.nix index 2e14c40e2..913ee4f9e 100644 --- a/modules/home/programs/terminal/media/ncmpcpp/default.nix +++ b/modules/home/programs/terminal/media/ncmpcpp/default.nix @@ -2,16 +2,16 @@ config, lib, pkgs, - namespace, + ... }: let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.programs.terminal.media.ncmpcpp; + cfg = config.khanelinix.programs.terminal.media.ncmpcpp; in { - options.${namespace}.programs.terminal.media.ncmpcpp = { + options.khanelinix.programs.terminal.media.ncmpcpp = { enable = mkEnableOption "ncmpcpp"; }; @@ -46,9 +46,7 @@ in } ]; - mpdMusicDir = - mkIf config.${namespace}.services.mpd.enable - config.${namespace}.services.mpd.musicDirectory; + mpdMusicDir = mkIf config.khanelinix.services.mpd.enable config.khanelinix.services.mpd.musicDirectory; settings = { # TODO: see how much UI customization can be done diff --git a/modules/home/programs/terminal/media/ncspot/default.nix b/modules/home/programs/terminal/media/ncspot/default.nix index c56308c25..454bc657d 100644 --- a/modules/home/programs/terminal/media/ncspot/default.nix +++ b/modules/home/programs/terminal/media/ncspot/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + ... }: let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.programs.terminal.media.ncspot; + cfg = config.khanelinix.programs.terminal.media.ncspot; in { - options.${namespace}.programs.terminal.media.ncspot = { + options.khanelinix.programs.terminal.media.ncspot = { enable = mkEnableOption "ncspot"; }; diff --git a/modules/home/programs/terminal/shells/bash/default.nix b/modules/home/programs/terminal/shells/bash/default.nix index 449abadfb..6aa1ca413 100644 --- a/modules/home/programs/terminal/shells/bash/default.nix +++ b/modules/home/programs/terminal/shells/bash/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.shell.bash; + cfg = config.khanelinix.programs.terminal.shell.bash; in { - options.${namespace}.programs.terminal.shell.bash = { + options.khanelinix.programs.terminal.shell.bash = { enable = mkBoolOpt false "Whether to enable bash."; }; diff --git a/modules/home/programs/terminal/shells/fish/default.nix b/modules/home/programs/terminal/shells/fish/default.nix index 53ed2d2a4..2ca0449b7 100644 --- a/modules/home/programs/terminal/shells/fish/default.nix +++ b/modules/home/programs/terminal/shells/fish/default.nix @@ -3,17 +3,17 @@ lib, pkgs, osConfig, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.shell.fish; + cfg = config.khanelinix.programs.terminal.shell.fish; in { - options.${namespace}.programs.terminal.shell.fish = { + options.khanelinix.programs.terminal.shell.fish = { enable = mkBoolOpt false "Whether to enable fish."; }; diff --git a/modules/home/programs/terminal/shells/nushell/default.nix b/modules/home/programs/terminal/shells/nushell/default.nix index 7fb44bdc3..821e4ef0c 100644 --- a/modules/home/programs/terminal/shells/nushell/default.nix +++ b/modules/home/programs/terminal/shells/nushell/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + ... }: let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.programs.terminal.shell.nushell; + cfg = config.khanelinix.programs.terminal.shell.nushell; in { - options.${namespace}.programs.terminal.shell.nushell = { + options.khanelinix.programs.terminal.shell.nushell = { enable = mkEnableOption "nushell"; }; diff --git a/modules/home/programs/terminal/shells/zsh/default.nix b/modules/home/programs/terminal/shells/zsh/default.nix index fbdd47aeb..07eb3d3f4 100644 --- a/modules/home/programs/terminal/shells/zsh/default.nix +++ b/modules/home/programs/terminal/shells/zsh/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + ... }: let inherit (lib) mkEnableOption mkIf; inherit (lib.strings) fileContents; - cfg = config.${namespace}.programs.terminal.shell.zsh; + cfg = config.khanelinix.programs.terminal.shell.zsh; in { - options.${namespace}.programs.terminal.shell.zsh = { + options.khanelinix.programs.terminal.shell.zsh = { enable = mkEnableOption "ZSH"; }; diff --git a/modules/home/programs/terminal/social/slack-term/default.nix b/modules/home/programs/terminal/social/slack-term/default.nix index 2b0b0bd79..4b0218615 100644 --- a/modules/home/programs/terminal/social/slack-term/default.nix +++ b/modules/home/programs/terminal/social/slack-term/default.nix @@ -1,28 +1,29 @@ { config, + khanelinix-lib, lib, - pkgs, - namespace, osConfig, + pkgs, + root, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.social.slack-term; + cfg = config.khanelinix.programs.terminal.social.slack-term; in { - options.${namespace}.programs.terminal.social.slack-term = { + options.khanelinix.programs.terminal.social.slack-term = { enable = mkBoolOpt false "Whether or not to enable slack-term."; }; config = mkIf cfg.enable { home.packages = [ pkgs.slack-term ]; - sops.secrets = lib.mkIf osConfig.${namespace}.security.sops.enable { + sops.secrets = lib.mkIf osConfig.khanelinix.security.sops.enable { slack-term = { - sopsFile = lib.snowfall.fs.get-file "secrets/khaneliman/default.yaml"; + sopsFile = root + "/secrets/khaneliman/default.yaml"; path = "${config.home.homeDirectory}/.config/slack-term/config"; }; }; diff --git a/modules/home/programs/terminal/social/twitch-tui/default.nix b/modules/home/programs/terminal/social/twitch-tui/default.nix index b62134359..fab5e691d 100644 --- a/modules/home/programs/terminal/social/twitch-tui/default.nix +++ b/modules/home/programs/terminal/social/twitch-tui/default.nix @@ -1,27 +1,28 @@ { config, lib, + khanelinix-lib, pkgs, - namespace, + root, osConfig, ... }: let - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.social.twitch-tui; + cfg = config.khanelinix.programs.terminal.social.twitch-tui; in { - options.${namespace}.programs.terminal.social.twitch-tui = { + options.khanelinix.programs.terminal.social.twitch-tui = { enable = mkBoolOpt false "Whether or not to enable twitch-tui."; }; config = lib.mkIf cfg.enable { home.packages = [ pkgs.twitch-tui ]; - sops.secrets = lib.mkIf osConfig.${namespace}.security.sops.enable { + sops.secrets = lib.mkIf osConfig.khanelinix.security.sops.enable { twitch-tui = { - sopsFile = lib.snowfall.fs.get-file "secrets/khaneliman/default.yaml"; + sopsFile = root + "/secrets/khaneliman/default.yaml"; path = "${config.home.homeDirectory}/.config/twt/config.toml"; }; }; diff --git a/modules/home/programs/terminal/tools/_1password-cli/default.nix b/modules/home/programs/terminal/tools/_1password-cli/default.nix index fa722f591..5733a5c2e 100644 --- a/modules/home/programs/terminal/tools/_1password-cli/default.nix +++ b/modules/home/programs/terminal/tools/_1password-cli/default.nix @@ -1,18 +1,18 @@ { config, lib, - namespace, + khanelinix-lib, pkgs, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools._1password-cli; + cfg = config.khanelinix.programs.terminal.tools._1password-cli; in { - options.${namespace}.programs.terminal.tools._1password-cli = { + options.khanelinix.programs.terminal.tools._1password-cli = { enable = mkBoolOpt false "Whether or not to enable 1password-cli."; enableSshSocket = mkBoolOpt false "Whether or not to enable ssh-agent socket."; }; diff --git a/modules/home/programs/terminal/tools/azure/default.nix b/modules/home/programs/terminal/tools/azure/default.nix index ad5cdb938..554562968 100644 --- a/modules/home/programs/terminal/tools/azure/default.nix +++ b/modules/home/programs/terminal/tools/azure/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.azure; + cfg = config.khanelinix.programs.terminal.tools.azure; in { - options.${namespace}.programs.terminal.tools.azure = { + options.khanelinix.programs.terminal.tools.azure = { enable = mkBoolOpt false "Whether or not to enable common Azure utilities."; }; diff --git a/modules/home/programs/terminal/tools/bat/default.nix b/modules/home/programs/terminal/tools/bat/default.nix index 9441708c6..8692f1cdd 100644 --- a/modules/home/programs/terminal/tools/bat/default.nix +++ b/modules/home/programs/terminal/tools/bat/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) getExe mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.bat; + cfg = config.khanelinix.programs.terminal.tools.bat; in { - options.${namespace}.programs.terminal.tools.bat = { + options.khanelinix.programs.terminal.tools.bat = { enable = mkBoolOpt false "Whether or not to enable bat."; }; diff --git a/modules/home/programs/terminal/tools/bottom/default.nix b/modules/home/programs/terminal/tools/bottom/default.nix index af3710171..5e396627a 100644 --- a/modules/home/programs/terminal/tools/bottom/default.nix +++ b/modules/home/programs/terminal/tools/bottom/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.bottom; + cfg = config.khanelinix.programs.terminal.tools.bottom; in { - options.${namespace}.programs.terminal.tools.bottom = { + options.khanelinix.programs.terminal.tools.bottom = { enable = mkBoolOpt false "Whether or not to enable bottom."; }; diff --git a/modules/home/programs/terminal/tools/btop/default.nix b/modules/home/programs/terminal/tools/btop/default.nix index a6b3bc0d4..3fdb7488a 100644 --- a/modules/home/programs/terminal/tools/btop/default.nix +++ b/modules/home/programs/terminal/tools/btop/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.btop; + cfg = config.khanelinix.programs.terminal.tools.btop; in { - options.${namespace}.programs.terminal.tools.btop = { + options.khanelinix.programs.terminal.tools.btop = { enable = mkBoolOpt false "Whether or not to enable btop."; }; diff --git a/modules/home/programs/terminal/tools/carapace/default.nix b/modules/home/programs/terminal/tools/carapace/default.nix index 97f3ab36e..1ebe7585f 100644 --- a/modules/home/programs/terminal/tools/carapace/default.nix +++ b/modules/home/programs/terminal/tools/carapace/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.carapace; + cfg = config.khanelinix.programs.terminal.tools.carapace; in { - options.${namespace}.programs.terminal.tools.carapace = { + options.khanelinix.programs.terminal.tools.carapace = { enable = mkBoolOpt false "Whether or not to enable carapace."; }; diff --git a/modules/home/programs/terminal/tools/cava/default.nix b/modules/home/programs/terminal/tools/cava/default.nix index b64acfe09..56554a164 100644 --- a/modules/home/programs/terminal/tools/cava/default.nix +++ b/modules/home/programs/terminal/tools/cava/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.cava; + cfg = config.khanelinix.programs.terminal.tools.cava; in { - options.${namespace}.programs.terminal.tools.cava = { + options.khanelinix.programs.terminal.tools.cava = { enable = mkBoolOpt false "Whether or not to enable cava."; }; diff --git a/modules/home/programs/terminal/tools/colorls/default.nix b/modules/home/programs/terminal/tools/colorls/default.nix index 27985aa97..3d75ca561 100644 --- a/modules/home/programs/terminal/tools/colorls/default.nix +++ b/modules/home/programs/terminal/tools/colorls/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.colorls; + cfg = config.khanelinix.programs.terminal.tools.colorls; in { - options.${namespace}.programs.terminal.tools.colorls = { + options.khanelinix.programs.terminal.tools.colorls = { enable = mkBoolOpt false "Whether or not to enable colorls."; }; diff --git a/modules/home/programs/terminal/tools/comma/default.nix b/modules/home/programs/terminal/tools/comma/default.nix index 1b8f9250b..7c24bb2a6 100644 --- a/modules/home/programs/terminal/tools/comma/default.nix +++ b/modules/home/programs/terminal/tools/comma/default.nix @@ -1,22 +1,27 @@ { config, + inputs, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.comma; + cfg = config.khanelinix.programs.terminal.tools.comma; in { - options.${namespace}.programs.terminal.tools.comma = { + imports = lib.optional ( + inputs.nix-index-database ? hmModules + ) inputs.nix-index-database.hmModules.nix-index; + + options.khanelinix.programs.terminal.tools.comma = { enable = mkBoolOpt false "Whether or not to enable comma."; }; - config = mkIf cfg.enable { + config = mkIf (cfg.enable && (inputs.nix-index-database ? hmModules)) { programs = { nix-index-database.comma.enable = true; diff --git a/modules/home/programs/terminal/tools/direnv/default.nix b/modules/home/programs/terminal/tools/direnv/default.nix index a9f4d468f..dad46e606 100644 --- a/modules/home/programs/terminal/tools/direnv/default.nix +++ b/modules/home/programs/terminal/tools/direnv/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.programs.terminal.tools.direnv; + cfg = config.khanelinix.programs.terminal.tools.direnv; in { - options.${namespace}.programs.terminal.tools.direnv = { + options.khanelinix.programs.terminal.tools.direnv = { enable = mkBoolOpt false "Whether or not to enable direnv."; }; diff --git a/modules/home/programs/terminal/tools/eza/default.nix b/modules/home/programs/terminal/tools/eza/default.nix index 3e8f648a5..7ee995631 100644 --- a/modules/home/programs/terminal/tools/eza/default.nix +++ b/modules/home/programs/terminal/tools/eza/default.nix @@ -2,16 +2,16 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.eza; + cfg = config.khanelinix.programs.terminal.tools.eza; in { - options.${namespace}.programs.terminal.tools.eza = { + options.khanelinix.programs.terminal.tools.eza = { enable = mkBoolOpt false "Whether or not to enable eza."; }; diff --git a/modules/home/programs/terminal/tools/fastfetch/default.nix b/modules/home/programs/terminal/tools/fastfetch/default.nix index 541c9372e..17f9c9364 100644 --- a/modules/home/programs/terminal/tools/fastfetch/default.nix +++ b/modules/home/programs/terminal/tools/fastfetch/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.fastfetch; + cfg = config.khanelinix.programs.terminal.tools.fastfetch; in { - options.${namespace}.programs.terminal.tools.fastfetch = { + options.khanelinix.programs.terminal.tools.fastfetch = { enable = mkBoolOpt false "Whether or not to enable fastfetch."; }; diff --git a/modules/home/programs/terminal/tools/fup-repl/default.nix b/modules/home/programs/terminal/tools/fup-repl/default.nix index 506934b39..be01db5e4 100644 --- a/modules/home/programs/terminal/tools/fup-repl/default.nix +++ b/modules/home/programs/terminal/tools/fup-repl/default.nix @@ -2,21 +2,21 @@ lib, pkgs, config, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf getExe'; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.fup-repl; + cfg = config.khanelinix.programs.terminal.tools.fup-repl; fup-repl = pkgs.writeShellScriptBin "fup-repl" '' ${getExe' pkgs.fup-repl "repl"} ''${@} ''; in { - options.${namespace}.programs.terminal.tools.fup-repl = { + options.khanelinix.programs.terminal.tools.fup-repl = { enable = mkBoolOpt false "Whether to enable fup-repl or not"; }; diff --git a/modules/home/programs/terminal/tools/fzf/default.nix b/modules/home/programs/terminal/tools/fzf/default.nix index 4400a178e..30ca193a7 100644 --- a/modules/home/programs/terminal/tools/fzf/default.nix +++ b/modules/home/programs/terminal/tools/fzf/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.fzf; + cfg = config.khanelinix.programs.terminal.tools.fzf; in { - options.${namespace}.programs.terminal.tools.fzf = { + options.khanelinix.programs.terminal.tools.fzf = { enable = mkBoolOpt false "Whether or not to enable fzf."; }; diff --git a/modules/home/programs/terminal/tools/git-crypt/default.nix b/modules/home/programs/terminal/tools/git-crypt/default.nix index fcb361e61..f4489b716 100644 --- a/modules/home/programs/terminal/tools/git-crypt/default.nix +++ b/modules/home/programs/terminal/tools/git-crypt/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.git-crypt; + cfg = config.khanelinix.programs.terminal.tools.git-crypt; in { - options.${namespace}.programs.terminal.tools.git-crypt = { + options.khanelinix.programs.terminal.tools.git-crypt = { enable = mkBoolOpt false "Whether or not to enable git-crypt."; }; diff --git a/modules/home/programs/terminal/tools/git/default.nix b/modules/home/programs/terminal/tools/git/default.nix index 519afcb07..482b3d2c1 100644 --- a/modules/home/programs/terminal/tools/git/default.nix +++ b/modules/home/programs/terminal/tools/git/default.nix @@ -2,7 +2,8 @@ config, lib, pkgs, - namespace, + root, + khanelinix-lib, osConfig, ... }: @@ -14,16 +15,16 @@ let mkForce getExe' ; - inherit (lib.${namespace}) mkOpt mkBoolOpt enabled; - inherit (config.${namespace}) user; + inherit (khanelinix-lib) mkOpt mkBoolOpt enabled; + inherit (config.khanelinix) user; - cfg = config.${namespace}.programs.terminal.tools.git; + cfg = config.khanelinix.programs.terminal.tools.git; aliases = import ./aliases.nix { inherit lib pkgs; }; ignores = import ./ignores.nix; tokenExports = - lib.optionalString osConfig.${namespace}.security.sops.enable # Bash + lib.optionalString osConfig.khanelinix.security.sops.enable # Bash '' if [ -f ${config.sops.secrets."github/access-token".path} ]; then GITHUB_TOKEN="$(cat ${config.sops.secrets."github/access-token".path})" @@ -34,7 +35,7 @@ let ''; in { - options.${namespace}.programs.terminal.tools.git = { + options.khanelinix.programs.terminal.tools.git = { enable = mkEnableOption "Git"; includes = mkOpt (types.listOf types.attrs) [ ] "Git includeIf paths and conditions."; signByDefault = mkOpt types.bool true "Whether to sign commits by default."; @@ -127,7 +128,7 @@ in safe = { directory = [ - "~/${namespace}/" + "~/khanelinix/" "/etc/nixos" ]; }; @@ -172,9 +173,9 @@ in inherit (aliases) shellAliases; }; - sops.secrets = lib.mkIf osConfig.${namespace}.security.sops.enable { + sops.secrets = lib.mkIf osConfig.khanelinix.security.sops.enable { "github/access-token" = { - sopsFile = lib.snowfall.fs.get-file "secrets/khaneliman/default.yaml"; + sopsFile = root + "/secrets/khaneliman/default.yaml"; path = "${config.home.homeDirectory}/.config/gh/access-token"; }; }; diff --git a/modules/home/programs/terminal/tools/glxinfo/default.nix b/modules/home/programs/terminal/tools/glxinfo/default.nix index 277740645..74f854369 100644 --- a/modules/home/programs/terminal/tools/glxinfo/default.nix +++ b/modules/home/programs/terminal/tools/glxinfo/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.glxinfo; + cfg = config.khanelinix.programs.terminal.tools.glxinfo; in { - options.${namespace}.programs.terminal.tools.glxinfo = { + options.khanelinix.programs.terminal.tools.glxinfo = { enable = mkBoolOpt false "Whether or not to enable glxinfo."; }; diff --git a/modules/home/programs/terminal/tools/go/default.nix b/modules/home/programs/terminal/tools/go/default.nix index 4b3db7b1b..46fda1d2a 100644 --- a/modules/home/programs/terminal/tools/go/default.nix +++ b/modules/home/programs/terminal/tools/go/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.go; + cfg = config.khanelinix.programs.terminal.tools.go; in { - options.${namespace}.programs.terminal.tools.go = { + options.khanelinix.programs.terminal.tools.go = { enable = mkBoolOpt false "Whether or not to enable Go support."; }; diff --git a/modules/home/programs/terminal/tools/jq/default.nix b/modules/home/programs/terminal/tools/jq/default.nix index 2362eef4d..734ffc8df 100644 --- a/modules/home/programs/terminal/tools/jq/default.nix +++ b/modules/home/programs/terminal/tools/jq/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.jq; + cfg = config.khanelinix.programs.terminal.tools.jq; in { - options.${namespace}.programs.terminal.tools.jq = { + options.khanelinix.programs.terminal.tools.jq = { enable = mkBoolOpt false "Whether or not to enable jq."; }; diff --git a/modules/home/programs/terminal/tools/jujutsu/default.nix b/modules/home/programs/terminal/tools/jujutsu/default.nix index e3e42a8f1..d3d9bad95 100644 --- a/modules/home/programs/terminal/tools/jujutsu/default.nix +++ b/modules/home/programs/terminal/tools/jujutsu/default.nix @@ -2,18 +2,18 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) types mkEnableOption mkIf; - inherit (lib.${namespace}) mkOpt enabled; - inherit (config.${namespace}) user; + inherit (khanelinix-lib) mkOpt enabled; + inherit (config.khanelinix) user; - cfg = config.${namespace}.programs.terminal.tools.jujutsu; + cfg = config.khanelinix.programs.terminal.tools.jujutsu; in { - options.${namespace}.programs.terminal.tools.jujutsu = { + options.khanelinix.programs.terminal.tools.jujutsu = { enable = mkEnableOption "jujutsu"; signByDefault = mkOpt types.bool true "Whether to sign commits by default."; signingKey = diff --git a/modules/home/programs/terminal/tools/k9s/default.nix b/modules/home/programs/terminal/tools/k9s/default.nix index 4458769ee..b5cd3ed1f 100644 --- a/modules/home/programs/terminal/tools/k9s/default.nix +++ b/modules/home/programs/terminal/tools/k9s/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.k9s; + cfg = config.khanelinix.programs.terminal.tools.k9s; in { - options.${namespace}.programs.terminal.tools.k9s = { + options.khanelinix.programs.terminal.tools.k9s = { enable = mkBoolOpt false "Whether or not to enable k9s."; }; diff --git a/modules/home/programs/terminal/tools/lazydocker/default.nix b/modules/home/programs/terminal/tools/lazydocker/default.nix index 2a39cbd85..72bc8d891 100644 --- a/modules/home/programs/terminal/tools/lazydocker/default.nix +++ b/modules/home/programs/terminal/tools/lazydocker/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.lazydocker; + cfg = config.khanelinix.programs.terminal.tools.lazydocker; in { - options.${namespace}.programs.terminal.tools.lazydocker = { + options.khanelinix.programs.terminal.tools.lazydocker = { enable = mkBoolOpt false "Whether or not to enable lazydocker."; }; diff --git a/modules/home/programs/terminal/tools/lazygit/default.nix b/modules/home/programs/terminal/tools/lazygit/default.nix index 7f8573b77..34eadc6dc 100644 --- a/modules/home/programs/terminal/tools/lazygit/default.nix +++ b/modules/home/programs/terminal/tools/lazygit/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.lazygit; + cfg = config.khanelinix.programs.terminal.tools.lazygit; in { - options.${namespace}.programs.terminal.tools.lazygit = { + options.khanelinix.programs.terminal.tools.lazygit = { enable = mkBoolOpt false "Whether or not to enable lazygit."; }; @@ -22,7 +22,7 @@ in settings = { gui = { authorColors = { - "${config.${namespace}.user.fullName}" = "#c6a0f6"; + "${config.khanelinix.user.fullName}" = "#c6a0f6"; "dependabot[bot]" = "#eed49f"; }; branchColors = { diff --git a/modules/home/programs/terminal/tools/lsd/default.nix b/modules/home/programs/terminal/tools/lsd/default.nix index c2288863e..f77cb0de2 100644 --- a/modules/home/programs/terminal/tools/lsd/default.nix +++ b/modules/home/programs/terminal/tools/lsd/default.nix @@ -2,14 +2,14 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.lsd; + cfg = config.khanelinix.programs.terminal.tools.lsd; aliases = { @@ -19,7 +19,7 @@ let }; in { - options.${namespace}.programs.terminal.tools.lsd = { + options.khanelinix.programs.terminal.tools.lsd = { enable = mkBoolOpt false "Whether or not to enable lsd."; }; diff --git a/modules/home/programs/terminal/tools/oh-my-posh/default.nix b/modules/home/programs/terminal/tools/oh-my-posh/default.nix index e11af88fa..70b1f8864 100644 --- a/modules/home/programs/terminal/tools/oh-my-posh/default.nix +++ b/modules/home/programs/terminal/tools/oh-my-posh/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.oh-my-posh; + cfg = config.khanelinix.programs.terminal.tools.oh-my-posh; in { - options.${namespace}.programs.terminal.tools.oh-my-posh = { + options.khanelinix.programs.terminal.tools.oh-my-posh = { enable = mkBoolOpt false "Whether or not to enable oh-my-posh."; }; diff --git a/modules/home/programs/terminal/tools/prisma/default.nix b/modules/home/programs/terminal/tools/prisma/default.nix index 67d1f2a84..0759f9e68 100644 --- a/modules/home/programs/terminal/tools/prisma/default.nix +++ b/modules/home/programs/terminal/tools/prisma/default.nix @@ -2,17 +2,17 @@ lib, pkgs, config, - namespace, + khanelinix-lib, ... }: let inherit (lib) types mkIf getExe'; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.programs.terminal.tools.prisma; + cfg = config.khanelinix.programs.terminal.tools.prisma; in { - options.${namespace}.programs.terminal.tools.prisma = with types; { + options.khanelinix.programs.terminal.tools.prisma = with types; { enable = mkBoolOpt false "Whether or not to install Prisma"; pkgs = { npm = mkOpt package pkgs.nodePackages.prisma "The NPM package to install"; diff --git a/modules/home/programs/terminal/tools/ripgrep/default.nix b/modules/home/programs/terminal/tools/ripgrep/default.nix index 6a957a2ff..14cd9d6b0 100644 --- a/modules/home/programs/terminal/tools/ripgrep/default.nix +++ b/modules/home/programs/terminal/tools/ripgrep/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) getExe mkForce mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.ripgrep; + cfg = config.khanelinix.programs.terminal.tools.ripgrep; in { - options.${namespace}.programs.terminal.tools.ripgrep = { + options.khanelinix.programs.terminal.tools.ripgrep = { enable = mkBoolOpt false "Whether or not to enable ripgrep."; }; diff --git a/modules/home/programs/terminal/tools/run-as-service/default.nix b/modules/home/programs/terminal/tools/run-as-service/default.nix index eb5ec601d..166cbdf41 100644 --- a/modules/home/programs/terminal/tools/run-as-service/default.nix +++ b/modules/home/programs/terminal/tools/run-as-service/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, pkgs, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; inherit (lib.strings) optionalString concatStringsSep; inherit (lib.attrsets) mapAttrsToList; - cfg = config.${namespace}.programs.terminal.tools.run-as-service; + cfg = config.khanelinix.programs.terminal.tools.run-as-service; sessionPath = optionalString (config.home.sessionPath != [ ]) '' export PATH=${concatStringsSep ":" config.home.sessionPath}:$PATH @@ -41,7 +41,7 @@ let ''; in { - options.${namespace}.programs.terminal.tools.run-as-service = { + options.khanelinix.programs.terminal.tools.run-as-service = { enable = mkBoolOpt false "Whether or not to configure systemd-run support."; }; config = mkIf cfg.enable { home.packages = [ run-as-service ]; }; diff --git a/modules/home/programs/terminal/tools/ssh/default.nix b/modules/home/programs/terminal/tools/ssh/default.nix index 1b78ae0e5..fd9650094 100644 --- a/modules/home/programs/terminal/tools/ssh/default.nix +++ b/modules/home/programs/terminal/tools/ssh/default.nix @@ -3,7 +3,7 @@ lib, inputs, host, - namespace, + khanelinix-lib, ... }: let @@ -12,26 +12,26 @@ let mkIf foldl ; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.programs.terminal.tools.ssh; + cfg = config.khanelinix.programs.terminal.tools.ssh; name = host; - user = config.users.users.${config.${namespace}.user.name}; + user = config.users.users.${config.khanelinix.user.name}; user-id = builtins.toString user.uid; default-key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJAZIwy7nkz8CZYR/ZTSNr+7lRBW2AYy1jw06b44zaID"; other-hosts = lib.filterAttrs ( - key: host: key != name && (host.config.${namespace}.user.name or null) != null + key: host: key != name && (host.config.khanelinix.user.name or null) != null ) ((inputs.self.nixosConfigurations or { }) // (inputs.self.darwinConfigurations or { })); other-hosts-config = lib.foldl' ( acc: name: let remote = other-hosts.${name}; - remote-user-name = remote.config.${namespace}.user.name; + remote-user-name = remote.config.khanelinix.user.name; remote-user-id = builtins.toString remote.config.users.users.${remote-user-name}.uid; in acc @@ -52,7 +52,7 @@ let ) { } (builtins.attrNames other-hosts); in { - options.${namespace}.programs.terminal.tools.ssh = with types; { + options.khanelinix.programs.terminal.tools.ssh = with types; { enable = mkBoolOpt false "Whether or not to configure ssh support."; authorizedKeys = mkOpt (listOf str) [ default-key ] "The public keys to apply."; extraConfig = mkOpt str "" "Extra configuration to apply."; diff --git a/modules/home/programs/terminal/tools/tmux/default.nix b/modules/home/programs/terminal/tools/tmux/default.nix index 01613cda1..9644e2cd1 100644 --- a/modules/home/programs/terminal/tools/tmux/default.nix +++ b/modules/home/programs/terminal/tools/tmux/default.nix @@ -2,15 +2,16 @@ config, lib, pkgs, - namespace, + khanelinix-lib, + root, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.tmux; - configFiles = lib.snowfall.fs.get-files ./config; + cfg = config.khanelinix.programs.terminal.tools.tmux; + configFiles = root + ./config; plugins = with pkgs.tmuxPlugins; [ { @@ -34,7 +35,7 @@ let ]; in { - options.${namespace}.programs.terminal.tools.tmux = { + options.khanelinix.programs.terminal.tools.tmux = { enable = mkBoolOpt false "Whether or not to enable tmux."; }; diff --git a/modules/home/programs/terminal/tools/topgrade/default.nix b/modules/home/programs/terminal/tools/topgrade/default.nix index 869bf447f..b2693cd33 100644 --- a/modules/home/programs/terminal/tools/topgrade/default.nix +++ b/modules/home/programs/terminal/tools/topgrade/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.topgrade; + cfg = config.khanelinix.programs.terminal.tools.topgrade; in { - options.${namespace}.programs.terminal.tools.topgrade = { + options.khanelinix.programs.terminal.tools.topgrade = { enable = mkBoolOpt false "Whether or not to enable topgrade."; }; diff --git a/modules/home/programs/terminal/tools/wine/default.nix b/modules/home/programs/terminal/tools/wine/default.nix index 9bfa89d9b..5dca11ff1 100644 --- a/modules/home/programs/terminal/tools/wine/default.nix +++ b/modules/home/programs/terminal/tools/wine/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.wine; + cfg = config.khanelinix.programs.terminal.tools.wine; in { - options.${namespace}.programs.terminal.tools.wine = { + options.khanelinix.programs.terminal.tools.wine = { enable = mkBoolOpt false "Whether or not to enable Wine."; }; diff --git a/modules/home/programs/terminal/tools/yazi/default.nix b/modules/home/programs/terminal/tools/yazi/default.nix index b821db261..80eb694a3 100644 --- a/modules/home/programs/terminal/tools/yazi/default.nix +++ b/modules/home/programs/terminal/tools/yazi/default.nix @@ -2,28 +2,28 @@ config, lib, pkgs, - namespace, + khanelinix-lib, inputs, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; completion = import ./keymap/completion.nix { }; help = import ./keymap/help.nix { }; input = import ./keymap/input.nix { }; - manager = import ./keymap/manager.nix { inherit config namespace; }; + manager = import ./keymap/manager.nix { inherit config; }; select = import ./keymap/select.nix { }; tasks = import ./keymap/tasks.nix { }; inherit (inputs) yazi-plugins; - cfg = config.${namespace}.programs.terminal.tools.yazi; + cfg = config.khanelinix.programs.terminal.tools.yazi; in { imports = lib.snowfall.fs.get-non-default-nix-files ./configs/plugins; - options.${namespace}.programs.terminal.tools.yazi = { + options.khanelinix.programs.terminal.tools.yazi = { enable = mkBoolOpt false "Whether or not to enable yazi."; }; diff --git a/modules/home/programs/terminal/tools/yazi/keymap/manager.nix b/modules/home/programs/terminal/tools/yazi/keymap/manager.nix index 885a1ea7c..8461a7729 100644 --- a/modules/home/programs/terminal/tools/yazi/keymap/manager.nix +++ b/modules/home/programs/terminal/tools/yazi/keymap/manager.nix @@ -1,4 +1,4 @@ -{ config, namespace, ... }: +{ config, ... }: let copy = import ./manager/copy.nix { }; find = import ./manager/find.nix { }; diff --git a/modules/home/programs/terminal/tools/yazi/keymap/manager/goto.nix b/modules/home/programs/terminal/tools/yazi/keymap/manager/goto.nix index f6130c950..055d2a6bd 100644 --- a/modules/home/programs/terminal/tools/yazi/keymap/manager/goto.nix +++ b/modules/home/programs/terminal/tools/yazi/keymap/manager/goto.nix @@ -1,4 +1,4 @@ -{ config, namespace, ... }: +{ config, ... }: { keymap = [ # Goto @@ -111,7 +111,7 @@ "g" "i" ]; - run = "cd /run/media/${config.${namespace}.user.name}"; + run = "cd /run/media/${config.khanelinix.user.name}"; desc = "Run command to change to media directory"; } { diff --git a/modules/home/programs/terminal/tools/zellij/default.nix b/modules/home/programs/terminal/tools/zellij/default.nix index d72cc39fe..1df71e95c 100644 --- a/modules/home/programs/terminal/tools/zellij/default.nix +++ b/modules/home/programs/terminal/tools/zellij/default.nix @@ -2,14 +2,14 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.zellij; + cfg = config.khanelinix.programs.terminal.tools.zellij; zns = "zellij -s $(basename $(pwd)) -l dev options --default-cwd $(pwd)"; zas = "zellij a $(basename $(pwd))"; @@ -20,7 +20,7 @@ let ''; in { - options.${namespace}.programs.terminal.tools.zellij = { + options.khanelinix.programs.terminal.tools.zellij = { enable = mkBoolOpt false "Whether or not to enable zellij."; }; diff --git a/modules/home/programs/terminal/tools/zoxide/default.nix b/modules/home/programs/terminal/tools/zoxide/default.nix index 1a02250ef..46b190df8 100644 --- a/modules/home/programs/terminal/tools/zoxide/default.nix +++ b/modules/home/programs/terminal/tools/zoxide/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.zoxide; + cfg = config.khanelinix.programs.terminal.tools.zoxide; in { - options.${namespace}.programs.terminal.tools.zoxide = { + options.khanelinix.programs.terminal.tools.zoxide = { enable = mkBoolOpt false "Whether or not to enable zoxide."; }; diff --git a/modules/home/services/cliphist/default.nix b/modules/home/services/cliphist/default.nix index c89702fd0..4626b80ab 100644 --- a/modules/home/services/cliphist/default.nix +++ b/modules/home/services/cliphist/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + ... }: let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.services.cliphist; + cfg = config.khanelinix.services.cliphist; in { - options.${namespace}.services.cliphist = { + options.khanelinix.services.cliphist = { enable = mkEnableOption "cliphist"; systemdTargets = lib.mkOption { diff --git a/modules/home/services/easyeffects/default.nix b/modules/home/services/easyeffects/default.nix index 322a0db3d..731274fbc 100644 --- a/modules/home/services/easyeffects/default.nix +++ b/modules/home/services/easyeffects/default.nix @@ -1,14 +1,14 @@ { config, lib, - namespace, + ... }: let - cfg = config.${namespace}.services.easyeffects; + cfg = config.khanelinix.services.easyeffects; in { - options.${namespace}.services.easyeffects = { + options.khanelinix.services.easyeffects = { enable = lib.mkEnableOption "easyeffects"; }; diff --git a/modules/home/services/hypridle/default.nix b/modules/home/services/hypridle/default.nix index 1c13854de..5a1d3ef58 100644 --- a/modules/home/services/hypridle/default.nix +++ b/modules/home/services/hypridle/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf getExe getExe'; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.hypridle; + cfg = config.khanelinix.services.hypridle; in { - options.${namespace}.services.hypridle = { + options.khanelinix.services.hypridle = { enable = mkBoolOpt false "Whether to enable hypridle service."; }; diff --git a/modules/home/services/hyprpaper/default.nix b/modules/home/services/hyprpaper/default.nix index 644aa7599..6eb1e81c7 100644 --- a/modules/home/services/hyprpaper/default.nix +++ b/modules/home/services/hyprpaper/default.nix @@ -2,9 +2,8 @@ config, inputs, lib, - pkgs, system, - namespace, + khanelinix-lib, ... }: let @@ -15,12 +14,16 @@ let mkOption ; inherit (inputs) hypr-socket-watch; - inherit (lib.${namespace}) mkOpt; + inherit (khanelinix-lib) mkOpt; - cfg = config.${namespace}.services.hyprpaper; + cfg = config.khanelinix.services.hyprpaper; in { - options.${namespace}.services.hyprpaper = { + imports = lib.optional ( + inputs.hypr-socket-watch ? homeManagerModules + ) inputs.hypr-socket-watch.homeManagerModules.default; + + options.khanelinix.services.hyprpaper = { enable = mkEnableOption "Hyprpaper"; enableSocketWatch = mkEnableOption "hypr-socket-watch"; monitors = mkOption { @@ -37,7 +40,7 @@ in wallpapers = mkOpt (types.listOf types.path) [ ] "Wallpapers to preload."; }; - config = mkIf cfg.enable { + config = mkIf (cfg.enable && (inputs.hypr-socket-watch ? homeManagerModules)) { services = { hyprpaper = { enable = true; @@ -53,7 +56,7 @@ in package = hypr-socket-watch.packages.${system}.hypr-socket-watch; monitor = "DP-1"; - wallpapers = "${pkgs.${namespace}.wallpapers}/share/wallpapers/"; + wallpapers = "${self.packages.${system}.wallpapers}/share/wallpapers/"; debug = false; }; }; diff --git a/modules/home/services/keyring/default.nix b/modules/home/services/keyring/default.nix index 68c8187dd..5d91f9599 100644 --- a/modules/home/services/keyring/default.nix +++ b/modules/home/services/keyring/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.keyring; + cfg = config.khanelinix.services.keyring; in { - options.${namespace}.services.keyring = { + options.khanelinix.services.keyring = { enable = mkBoolOpt false "Whether to enable gnome keyring."; }; diff --git a/modules/home/services/mpd/default.nix b/modules/home/services/mpd/default.nix index 960ec11f6..8dedbc2e3 100644 --- a/modules/home/services/mpd/default.nix +++ b/modules/home/services/mpd/default.nix @@ -2,7 +2,7 @@ config, lib, pkgs, - namespace, + ... }: let @@ -13,10 +13,10 @@ let types ; - cfg = config.${namespace}.services.mpd; + cfg = config.khanelinix.services.mpd; in { - options.${namespace}.services.mpd = { + options.khanelinix.services.mpd = { enable = mkEnableOption "mpd"; musicDirectory = mkOption { type = with types; either path str; diff --git a/modules/home/services/noisetorch/default.nix b/modules/home/services/noisetorch/default.nix index 3360429e8..4b91ef7ae 100644 --- a/modules/home/services/noisetorch/default.nix +++ b/modules/home/services/noisetorch/default.nix @@ -2,18 +2,18 @@ osConfig, config, lib, - namespace, + ... }: let inherit (lib) getExe mkIf mkEnableOption; - cfg = config.${namespace}.services.noisetorch; - osCfg = osConfig.${namespace}.programs.graphical.addons.noisetorch; + cfg = config.khanelinix.services.noisetorch; + osCfg = osConfig.khanelinix.programs.graphical.addons.noisetorch; in { options = { - ${namespace}.services.noisetorch = { + khanelinix.services.noisetorch = { enable = mkEnableOption "noisetorch service"; }; }; diff --git a/modules/home/services/rnnoise/default.nix b/modules/home/services/rnnoise/default.nix index 3a9955f08..e3b2e05d2 100644 --- a/modules/home/services/rnnoise/default.nix +++ b/modules/home/services/rnnoise/default.nix @@ -1,6 +1,6 @@ { pkgs, - namespace, + lib, config, ... @@ -10,11 +10,11 @@ let json = pkgs.formats.json { }; - cfg = config.${namespace}.services.rnnoise; + cfg = config.khanelinix.services.rnnoise; in { options = { - ${namespace}.services.rnnoise = { + khanelinix.services.rnnoise = { enable = mkEnableOption "rnnoise pipewire module"; }; }; diff --git a/modules/home/services/sops/default.nix b/modules/home/services/sops/default.nix index e687037e9..d7ce9a690 100644 --- a/modules/home/services/sops/default.nix +++ b/modules/home/services/sops/default.nix @@ -1,24 +1,28 @@ { config, + inputs, lib, - namespace, pkgs, + root, + khanelinix-lib, ... }: let inherit (lib) mkIf types; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.services.sops; + cfg = config.khanelinix.services.sops; in { - options.${namespace}.services.sops = with types; { + imports = lib.optional (inputs.sops-nix ? hmModules) inputs.sops-nix.hmModules.sops; + + options.khanelinix.services.sops = with types; { enable = mkBoolOpt false "Whether to enable sops."; defaultSopsFile = mkOpt path null "Default sops file."; sshKeyPaths = mkOpt (listOf path) [ ] "SSH Key paths to use."; }; - config = mkIf cfg.enable { + config = mkIf (cfg.enable && (inputs.sops-nix ? hmModules)) { home.packages = with pkgs; [ age sops @@ -37,7 +41,7 @@ in secrets = { nix = { - sopsFile = lib.snowfall.fs.get-file "secrets/khaneliman/default.yaml"; + sopsFile = root + "/secrets/khaneliman/default.yaml"; path = "${config.home.homeDirectory}/.config/nix/nix.conf"; }; }; diff --git a/modules/home/services/ssh-agent/default.nix b/modules/home/services/ssh-agent/default.nix index 9a3ee884c..d43e5fe4c 100644 --- a/modules/home/services/ssh-agent/default.nix +++ b/modules/home/services/ssh-agent/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.ssh-agent; + cfg = config.khanelinix.services.ssh-agent; in { - options.${namespace}.services.ssh-agent = { + options.khanelinix.services.ssh-agent = { enable = mkBoolOpt false "Whether to enable ssh-agent service."; }; diff --git a/modules/home/services/swayidle/default.nix b/modules/home/services/swayidle/default.nix index fc77baf2d..e61170af3 100644 --- a/modules/home/services/swayidle/default.nix +++ b/modules/home/services/swayidle/default.nix @@ -1,18 +1,18 @@ { config, lib, - namespace, + khanelinix-lib, pkgs, ... }: let inherit (lib) getExe getExe'; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.swayidle; + cfg = config.khanelinix.services.swayidle; in { - options.${namespace}.services.swayidle = { + options.khanelinix.services.swayidle = { enable = mkBoolOpt false "Whether to enable swayidle service."; }; diff --git a/modules/home/services/tray/default.nix b/modules/home/services/tray/default.nix index d155c5aba..91ac3fdeb 100644 --- a/modules/home/services/tray/default.nix +++ b/modules/home/services/tray/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + ... }: let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.services.tray; + cfg = config.khanelinix.services.tray; in { - options.${namespace}.services.tray = { + options.khanelinix.services.tray = { enable = mkEnableOption "tray"; }; diff --git a/modules/home/services/udiskie/default.nix b/modules/home/services/udiskie/default.nix index 8b492b25f..2d6bed583 100644 --- a/modules/home/services/udiskie/default.nix +++ b/modules/home/services/udiskie/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + ... }: let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.services.udiskie; + cfg = config.khanelinix.services.udiskie; in { - options.${namespace}.services.udiskie = { + options.khanelinix.services.udiskie = { enable = mkEnableOption "udiskie"; }; diff --git a/modules/home/suites/art/default.nix b/modules/home/suites/art/default.nix index 190b251c0..24b8d1dfe 100644 --- a/modules/home/suites/art/default.nix +++ b/modules/home/suites/art/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.art; + cfg = config.khanelinix.suites.art; in { - options.${namespace}.suites.art = { + options.khanelinix.suites.art = { enable = mkBoolOpt false "Whether or not to enable art configuration."; }; diff --git a/modules/home/suites/business/default.nix b/modules/home/suites/business/default.nix index 13c3c2515..96eda039f 100644 --- a/modules/home/suites/business/default.nix +++ b/modules/home/suites/business/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.suites.business; + cfg = config.khanelinix.suites.business; in { - options.${namespace}.suites.business = { + options.khanelinix.suites.business = { enable = mkBoolOpt false "Whether or not to enable business configuration."; }; diff --git a/modules/home/suites/common/default.nix b/modules/home/suites/common/default.nix index 1851d5b40..2f57bc5b2 100644 --- a/modules/home/suites/common/default.nix +++ b/modules/home/suites/common/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf mkDefault; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.suites.common; + cfg = config.khanelinix.suites.common; in { - options.${namespace}.suites.common = { + options.khanelinix.suites.common = { enable = mkBoolOpt false "Whether or not to enable common configuration."; }; @@ -24,7 +24,7 @@ in }; shellAliases = { - nixcfg = "nvim ~/${namespace}/flake.nix"; + nixcfg = "nvim ~/khanelinix/flake.nix"; }; }; diff --git a/modules/home/suites/desktop/default.nix b/modules/home/suites/desktop/default.nix index 77aa0635e..8422b3778 100644 --- a/modules/home/suites/desktop/default.nix +++ b/modules/home/suites/desktop/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.desktop; + cfg = config.khanelinix.suites.desktop; in { - options.${namespace}.suites.desktop = { + options.khanelinix.suites.desktop = { enable = mkBoolOpt false "Whether or not to enable common desktop applications."; }; diff --git a/modules/home/suites/development/default.nix b/modules/home/suites/development/default.nix index 03d5f5080..3d3621973 100644 --- a/modules/home/suites/development/default.nix +++ b/modules/home/suites/development/default.nix @@ -4,16 +4,16 @@ lib, osConfig, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf mkDefault; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; inherit (inputs) snowfall-flake; tokenExports = - lib.optionalString osConfig.${namespace}.security.sops.enable # Bash + lib.optionalString osConfig.khanelinix.security.sops.enable # Bash '' if [ -f ${config.sops.secrets.ANTHROPIC_API_KEY.path} ]; then ANTHROPIC_API_KEY="$(cat ${config.sops.secrets.ANTHROPIC_API_KEY.path})" @@ -29,10 +29,10 @@ let fi ''; - cfg = config.${namespace}.suites.development; + cfg = config.khanelinix.suites.development; in { - options.${namespace}.suites.development = { + options.khanelinix.suites.development = { enable = mkBoolOpt false "Whether or not to enable common development configuration."; azureEnable = mkBoolOpt false "Whether or not to enable azure development configuration."; dockerEnable = mkBoolOpt false "Whether or not to enable docker development configuration."; @@ -136,7 +136,7 @@ in }; }; - sops.secrets = lib.mkIf osConfig.${namespace}.security.sops.enable { + sops.secrets = lib.mkIf osConfig.khanelinix.security.sops.enable { ANTHROPIC_API_KEY = { sopsFile = lib.snowfall.fs.get-file "secrets/CORE/default.yaml"; path = "${config.home.homeDirectory}/.ANTHROPIC_API_KEY"; diff --git a/modules/home/suites/emulation/default.nix b/modules/home/suites/emulation/default.nix index 6964100e3..8239b2ff5 100644 --- a/modules/home/suites/emulation/default.nix +++ b/modules/home/suites/emulation/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.emulation; + cfg = config.khanelinix.suites.emulation; in { - options.${namespace}.suites.emulation = { + options.khanelinix.suites.emulation = { enable = mkBoolOpt false "Whether or not to enable emulation configuration."; retroarchFull = mkBoolOpt false "Whether or not to enable emulation configuration."; }; diff --git a/modules/home/suites/games/default.nix b/modules/home/suites/games/default.nix index dec858e5b..cb012c84b 100644 --- a/modules/home/suites/games/default.nix +++ b/modules/home/suites/games/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.suites.games; + cfg = config.khanelinix.suites.games; in { - options.${namespace}.suites.games = { + options.khanelinix.suites.games = { enable = mkBoolOpt false "Whether or not to enable common games configuration."; }; diff --git a/modules/home/suites/music/default.nix b/modules/home/suites/music/default.nix index fc5a4d1be..709f68877 100644 --- a/modules/home/suites/music/default.nix +++ b/modules/home/suites/music/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.suites.music; + cfg = config.khanelinix.suites.music; in { - options.${namespace}.suites.music = { + options.khanelinix.suites.music = { enable = mkBoolOpt false "Whether or not to enable common music configuration."; }; diff --git a/modules/home/suites/networking/default.nix b/modules/home/suites/networking/default.nix index b2be29345..6529b8a1f 100644 --- a/modules/home/suites/networking/default.nix +++ b/modules/home/suites/networking/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.networking; + cfg = config.khanelinix.suites.networking; in { - options.${namespace}.suites.networking = { + options.khanelinix.suites.networking = { enable = mkBoolOpt false "Whether or not to enable networking configuration."; }; diff --git a/modules/home/suites/photo/default.nix b/modules/home/suites/photo/default.nix index 4285a521f..c74c212f0 100644 --- a/modules/home/suites/photo/default.nix +++ b/modules/home/suites/photo/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.photo; + cfg = config.khanelinix.suites.photo; in { - options.${namespace}.suites.photo = { + options.khanelinix.suites.photo = { enable = mkBoolOpt false "Whether or not to enable photo configuration."; }; diff --git a/modules/home/suites/social/default.nix b/modules/home/suites/social/default.nix index a6887a563..3e16e643d 100644 --- a/modules/home/suites/social/default.nix +++ b/modules/home/suites/social/default.nix @@ -1,18 +1,18 @@ { config, lib, - namespace, + khanelinix-lib, pkgs, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.suites.social; + cfg = config.khanelinix.suites.social; in { - options.${namespace}.suites.social = { + options.khanelinix.suites.social = { enable = mkBoolOpt false "Whether or not to enable social configuration."; }; diff --git a/modules/home/suites/video/default.nix b/modules/home/suites/video/default.nix index 3bd127830..cb489bb84 100644 --- a/modules/home/suites/video/default.nix +++ b/modules/home/suites/video/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.suites.video; + cfg = config.khanelinix.suites.video; in { - options.${namespace}.suites.video = { + options.khanelinix.suites.video = { enable = mkBoolOpt false "Whether or not to enable video configuration."; }; diff --git a/modules/home/suites/wlroots/default.nix b/modules/home/suites/wlroots/default.nix index 4ced9071d..f2a5d5b8c 100644 --- a/modules/home/suites/wlroots/default.nix +++ b/modules/home/suites/wlroots/default.nix @@ -1,18 +1,18 @@ { config, lib, - namespace, + khanelinix-lib, pkgs, ... }: let inherit (lib) mkIf mkDefault; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.suites.wlroots; + cfg = config.khanelinix.suites.wlroots; in { - options.${namespace}.suites.wlroots = { + options.khanelinix.suites.wlroots = { enable = mkBoolOpt false "Whether or not to enable common wlroots configuration."; }; diff --git a/modules/home/system/xdg/default.nix b/modules/home/system/xdg/default.nix index 3cf27eef2..efaae809b 100644 --- a/modules/home/system/xdg/default.nix +++ b/modules/home/system/xdg/default.nix @@ -1,14 +1,14 @@ { config, lib, - namespace, + pkgs, ... }: let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.system.xdg; + cfg = config.khanelinix.system.xdg; browser = [ "firefox-devedition.desktop" @@ -158,7 +158,7 @@ let }; in { - options.${namespace}.system.xdg = { + options.khanelinix.system.xdg = { enable = mkEnableOption "xdg"; }; diff --git a/modules/home/theme/catppuccin/default.nix b/modules/home/theme/catppuccin/default.nix index fe95a29ec..71400b390 100644 --- a/modules/home/theme/catppuccin/default.nix +++ b/modules/home/theme/catppuccin/default.nix @@ -1,8 +1,9 @@ { config, + inputs, lib, pkgs, - namespace, + khanelinix-lib, ... }: let @@ -13,9 +14,9 @@ let mkOption types ; - inherit (lib.${namespace}) enabled capitalize; + inherit (khanelinix-lib) enabled capitalize; - cfg = config.${namespace}.theme.catppuccin; + cfg = config.khanelinix.theme.catppuccin; warpPkg = pkgs.fetchFromGitHub { owner = "catppuccin"; @@ -51,7 +52,11 @@ let ]; in { - options.${namespace}.theme.catppuccin = { + imports = lib.optional ( + inputs.catppuccin ? homeManagerModules + ) inputs.catppuccin.homeManagerModules.catppuccin; + + options.khanelinix.theme.catppuccin = { enable = mkEnableOption "Enable catppuccin theme for applications."; accent = mkOption { @@ -79,7 +84,7 @@ in }; }; - config = mkIf cfg.enable { + config = mkIf (cfg.enable && (inputs.catppuccin ? homeManagerModules)) { khanelinix = { theme = { gtk = mkIf pkgs.stdenv.isLinux { @@ -161,7 +166,7 @@ in zsh-syntax-highlighting = enabled; sway.enable = true; - hyprland = mkIf config.${namespace}.programs.graphical.wms.hyprland.enable { + hyprland = mkIf config.khanelinix.programs.graphical.wms.hyprland.enable { enable = true; inherit (cfg) accent; @@ -182,12 +187,12 @@ in ]; pointerCursor = mkIf pkgs.stdenv.isLinux { - inherit (config.${namespace}.theme.gtk.cursor) name package size; + inherit (config.khanelinix.theme.gtk.cursor) name package size; x11.enable = true; }; sessionVariables = mkIf pkgs.stdenv.isLinux { - CURSOR_THEME = config.${namespace}.theme.gtk.cursor.name; + CURSOR_THEME = config.khanelinix.theme.gtk.cursor.name; }; }; @@ -200,7 +205,7 @@ in style = { name = "kvantum"; - inherit (config.${namespace}.theme.qt.theme) package; + inherit (config.khanelinix.theme.qt.theme) package; }; }; @@ -332,7 +337,7 @@ in }; xdg.configFile = - mkIf (pkgs.stdenv.isLinux && config.${namespace}.programs.graphical.apps.discord.enable) + mkIf (pkgs.stdenv.isLinux && config.khanelinix.programs.graphical.apps.discord.enable) { "ArmCord/themes/Catppuccin-Macchiato-BD".source = ./Catppuccin-Macchiato-BD; "BetterDiscord/themes/catppuccin-macchiato.theme.css".source = ./catppuccin-macchiato.theme.css; diff --git a/modules/home/theme/catppuccin/yazi/manager.nix b/modules/home/theme/catppuccin/yazi/manager.nix index fb35338c3..5f8af0c0d 100644 --- a/modules/home/theme/catppuccin/yazi/manager.nix +++ b/modules/home/theme/catppuccin/yazi/manager.nix @@ -1,7 +1,6 @@ { config, - lib, - namespace, + khanelinix-lib, }: let catppuccin = import ../colors.nix; @@ -66,8 +65,8 @@ in }; syntect_theme = let - cfg = config.${namespace}.theme.catppuccin; - inherit (lib.${namespace}) capitalize; + cfg = config.khanelinix.theme.catppuccin; + inherit (khanelinix-lib) capitalize; in "/bat/Catppuccin ${capitalize cfg.flavor}.tmTheme"; }; diff --git a/modules/home/theme/gtk/default.nix b/modules/home/theme/gtk/default.nix index 8666669a0..76bf8422b 100644 --- a/modules/home/theme/gtk/default.nix +++ b/modules/home/theme/gtk/default.nix @@ -3,22 +3,22 @@ lib, pkgs, osConfig, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf mkDefault types; - inherit (lib.${namespace}) + inherit (khanelinix-lib) boolToNum mkBoolOpt mkOpt nested-default-attrs ; - cfg = config.${namespace}.theme.gtk; + cfg = config.khanelinix.theme.gtk; in { - options.${namespace}.theme.gtk = { + options.khanelinix.theme.gtk = { enable = mkBoolOpt false "Whether to customize GTK and apply themes."; usePortal = mkBoolOpt false "Whether to use the GTK Portal."; @@ -87,7 +87,7 @@ in cursor-size = cfg.cursor.size; cursor-theme = cfg.cursor.name; enable-hot-corners = false; - font-name = osConfig.${namespace}.system.fonts.default; + font-name = osConfig.khanelinix.system.fonts.default; gtk-theme = cfg.theme.name; icon-theme = cfg.icon.name; }; @@ -98,7 +98,7 @@ in enable = true; font = { - name = osConfig.${namespace}.system.fonts.default; + name = osConfig.khanelinix.system.fonts.default; }; gtk2 = { diff --git a/modules/home/theme/qt/default.nix b/modules/home/theme/qt/default.nix index 3c3a3e8d1..6b5b5a4cd 100644 --- a/modules/home/theme/qt/default.nix +++ b/modules/home/theme/qt/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) types mkDefault mkIf; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.theme.qt; + cfg = config.khanelinix.theme.qt; in { - options.${namespace}.theme.qt = with types; { + options.khanelinix.theme.qt = with types; { enable = mkBoolOpt false "Whether to customize qt and apply themes."; theme = { @@ -27,7 +27,7 @@ in Appearance = { color_scheme_path = mkOpt types.str "" "Color scheme path"; custom_palette = mkBoolOpt true "Whether to use custom palette"; - icon_theme = mkOpt types.str config.${namespace}.theme.gtk.icon.name "Icon theme"; + icon_theme = mkOpt types.str config.khanelinix.theme.gtk.icon.name "Icon theme"; standard_dialogs = mkOpt types.str "gtk3" "Dialog type"; style = mkOpt types.str "kvantum" "Style"; }; diff --git a/modules/home/user/default.nix b/modules/home/user/default.nix index 1b707aa35..ddb31db75 100644 --- a/modules/home/user/default.nix +++ b/modules/home/user/default.nix @@ -2,7 +2,7 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let @@ -14,9 +14,9 @@ let getExe getExe' ; - inherit (lib.${namespace}) mkOpt enabled; + inherit (khanelinix-lib) mkOpt enabled; - cfg = config.${namespace}.user; + cfg = config.khanelinix.user; home-directory = if cfg.name == null then @@ -27,13 +27,13 @@ let "/home/${cfg.name}"; in { - options.${namespace}.user = { + options.khanelinix.user = { enable = mkOpt types.bool false "Whether to configure the user account."; email = mkOpt types.str "khaneliman12@gmail.com" "The email of the user."; fullName = mkOpt types.str "Austin Horstman" "The full name of the user."; home = mkOpt (types.nullOr types.str) home-directory "The user's home directory."; icon = - mkOpt (types.nullOr types.package) pkgs.${namespace}.user-icon + mkOpt (types.nullOr types.package) self.packages.${system}.user-icon "The profile picture to use for the user."; name = mkOpt (types.nullOr types.str) config.snowfallorg.user.name "The user account."; }; @@ -43,11 +43,11 @@ in assertions = [ { assertion = cfg.name != null; - message = "${namespace}.user.name must be set"; + message = "khanelinix.user.name must be set"; } { assertion = cfg.home != null; - message = "${namespace}.user.home must be set"; + message = "khanelinix.user.home must be set"; } ]; @@ -85,7 +85,7 @@ in # getExe snowfall-flake.packages.${system}.flake # } switch"; nix = "nix -vL"; - hmvar-reload = ''__HM_ZSH_SESS_VARS_SOURCED=0 source "/etc/profiles/per-user/${config.${namespace}.user.name}/etc/profile.d/hm-session-vars.sh"''; + hmvar-reload = ''__HM_ZSH_SESS_VARS_SOURCED=0 source "/etc/profiles/per-user/${config.khanelinix.user.name}/etc/profile.d/hm-session-vars.sh"''; # NOTE: vim-add 'owner/repo' vim-add = ''nix run nixpkgs#vimPluginsUpdater add''; # NOTE: vim-update 'plugin-name' diff --git a/modules/nixos/archetypes/default.nix b/modules/nixos/archetypes/default.nix new file mode 100644 index 000000000..b041adaf9 --- /dev/null +++ b/modules/nixos/archetypes/default.nix @@ -0,0 +1,10 @@ +{ + imports = [ + ./gaming + ./personal + ./server + ./vm + ./workstation + ./wsl + ]; +} diff --git a/modules/nixos/archetypes/gaming/default.nix b/modules/nixos/archetypes/gaming/default.nix index e9502ef9c..80bfe37f4 100644 --- a/modules/nixos/archetypes/gaming/default.nix +++ b/modules/nixos/archetypes/gaming/default.nix @@ -1,22 +1,22 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.archetypes.gaming; + cfg = config.khanelinix.archetypes.gaming; in { - options.${namespace}.archetypes.gaming = { + options.khanelinix.archetypes.gaming = { enable = mkBoolOpt false "Whether or not to enable the gaming archetype."; }; config = mkIf cfg.enable { - ${namespace}.suites = { + khanelinix.suites = { common = enabled; desktop = enabled; games = enabled; diff --git a/modules/nixos/archetypes/personal/default.nix b/modules/nixos/archetypes/personal/default.nix index 7e5562d6e..e0e91d1c4 100644 --- a/modules/nixos/archetypes/personal/default.nix +++ b/modules/nixos/archetypes/personal/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.archetypes.personal; + cfg = config.khanelinix.archetypes.personal; in { - options.${namespace}.archetypes.personal = { + options.khanelinix.archetypes.personal = { enable = mkBoolOpt false "Whether or not to enable the personal archetype."; }; diff --git a/modules/nixos/archetypes/server/default.nix b/modules/nixos/archetypes/server/default.nix index 79fcdf3bb..214bcacde 100644 --- a/modules/nixos/archetypes/server/default.nix +++ b/modules/nixos/archetypes/server/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.archetypes.server; + cfg = config.khanelinix.archetypes.server; in { - options.${namespace}.archetypes.server = { + options.khanelinix.archetypes.server = { enable = mkBoolOpt false "Whether or not to enable the server archetype."; }; diff --git a/modules/nixos/archetypes/vm/default.nix b/modules/nixos/archetypes/vm/default.nix index ca3a016ef..5f2ccf942 100644 --- a/modules/nixos/archetypes/vm/default.nix +++ b/modules/nixos/archetypes/vm/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.archetypes.vm; + cfg = config.khanelinix.archetypes.vm; in { - options.${namespace}.archetypes.vm = { + options.khanelinix.archetypes.vm = { enable = mkBoolOpt false "Whether or not to enable the vm archetype."; }; diff --git a/modules/nixos/archetypes/workstation/default.nix b/modules/nixos/archetypes/workstation/default.nix index bacfd2318..2e8d25db6 100644 --- a/modules/nixos/archetypes/workstation/default.nix +++ b/modules/nixos/archetypes/workstation/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.archetypes.workstation; + cfg = config.khanelinix.archetypes.workstation; in { - options.${namespace}.archetypes.workstation = { + options.khanelinix.archetypes.workstation = { enable = mkBoolOpt false "Whether or not to enable the workstation archetype."; }; diff --git a/modules/nixos/archetypes/wsl/default.nix b/modules/nixos/archetypes/wsl/default.nix index c542f6a78..44bae1e4e 100644 --- a/modules/nixos/archetypes/wsl/default.nix +++ b/modules/nixos/archetypes/wsl/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf mkForce; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.archetypes.wsl; + cfg = config.khanelinix.archetypes.wsl; in { - options.${namespace}.archetypes.wsl = { + options.khanelinix.archetypes.wsl = { enable = mkBoolOpt false "Whether or not to enable the wsl archetype."; }; diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix new file mode 100644 index 000000000..405f3beac --- /dev/null +++ b/modules/nixos/default.nix @@ -0,0 +1,16 @@ +{ + imports = [ + ./archetypes + ./display-managers + ./hardware + ./home + ./nix + ./programs + ./security + ./suites + ./system + ./theme + ./user + ./virtualisation + ]; +} diff --git a/modules/nixos/display-managers/default.nix b/modules/nixos/display-managers/default.nix new file mode 100644 index 000000000..37bdee1b4 --- /dev/null +++ b/modules/nixos/display-managers/default.nix @@ -0,0 +1,9 @@ +{ + imports = [ + ./gdm + ./lightdm + ./regreet + ./sddm + ./tuigreet + ]; +} diff --git a/modules/nixos/display-managers/gdm/default.nix b/modules/nixos/display-managers/gdm/default.nix index afa0804cc..32ca8874a 100644 --- a/modules/nixos/display-managers/gdm/default.nix +++ b/modules/nixos/display-managers/gdm/default.nix @@ -2,7 +2,7 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let @@ -12,13 +12,13 @@ let getExe' stringAfter ; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.display-managers.gdm; + cfg = config.khanelinix.display-managers.gdm; gdmHome = config.users.users.gdm.home; in { - options.${namespace}.display-managers.gdm = with types; { + options.khanelinix.display-managers.gdm = with types; { enable = mkBoolOpt false "Whether or not to enable gdm."; autoSuspend = mkBoolOpt true "Whether or not to suspend the machine after inactivity."; defaultSession = mkOpt (nullOr str) null "The default session to use."; @@ -58,8 +58,8 @@ in stringAfter [ "users" ] # bash '' echo "Setting gdm permissions for user icon" - ${getExe' pkgs.acl "setfacl"} -m u:gdm:x /home/${config.${namespace}.user.name} - ${getExe' pkgs.acl "setfacl"} -m u:gdm:r /home/${config.${namespace}.user.name}/.face.icon || true + ${getExe' pkgs.acl "setfacl"} -m u:gdm:x /home/${config.khanelinix.user.name} + ${getExe' pkgs.acl "setfacl"} -m u:gdm:r /home/${config.khanelinix.user.name}/.face.icon || true ''; }; } diff --git a/modules/nixos/display-managers/lightdm/default.nix b/modules/nixos/display-managers/lightdm/default.nix index 708dc8158..b257a23a8 100644 --- a/modules/nixos/display-managers/lightdm/default.nix +++ b/modules/nixos/display-managers/lightdm/default.nix @@ -1,18 +1,19 @@ { config, lib, - pkgs, - namespace, + khanelinix-lib, + self, + system, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.display-managers.lightdm; + cfg = config.khanelinix.display-managers.lightdm; in { - options.${namespace}.display-managers.lightdm = { + options.khanelinix.display-managers.lightdm = { enable = mkBoolOpt false "Whether or not to enable lightdm."; }; @@ -22,25 +23,25 @@ in displayManager.lightdm = { enable = true; - background = pkgs.${namespace}.wallpapers.flatppuccin_macchiato; + background = self.packages.${system}.wallpapers.flatppuccin_macchiato; greeters = { gtk = { enable = true; cursorTheme = { - inherit (config.${namespace}.desktop.addons.gtk.cursor) name; - package = config.${namespace}.desktop.addons.gtk.cursor.pkg; + inherit (config.khanelinix.desktop.addons.gtk.cursor) name; + package = config.khanelinix.desktop.addons.gtk.cursor.pkg; }; iconTheme = { - inherit (config.${namespace}.desktop.addons.gtk.icon) name; - package = config.${namespace}.desktop.addons.gtk.icon.pkg; + inherit (config.khanelinix.desktop.addons.gtk.icon) name; + package = config.khanelinix.desktop.addons.gtk.icon.pkg; }; theme = { - name = "${config.${namespace}.desktop.addons.gtk.theme.name}"; - package = config.${namespace}.desktop.addons.gtk.theme.pkg; + name = "${config.khanelinix.desktop.addons.gtk.theme.name}"; + package = config.khanelinix.desktop.addons.gtk.theme.pkg; }; }; }; diff --git a/modules/nixos/display-managers/regreet/default.nix b/modules/nixos/display-managers/regreet/default.nix index a585254bd..86ea9d35a 100644 --- a/modules/nixos/display-managers/regreet/default.nix +++ b/modules/nixos/display-managers/regreet/default.nix @@ -3,8 +3,9 @@ inputs, lib, pkgs, + self, system, - namespace, + khanelinix-lib, ... }: let @@ -14,12 +15,12 @@ let getExe getExe' ; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; inherit (inputs) hyprland; - cfg = config.${namespace}.display-managers.regreet; - themeCfg = config.${namespace}.theme; - gtkCfg = config.${namespace}.desktop.addons.gtk; + cfg = config.khanelinix.display-managers.regreet; + themeCfg = config.khanelinix.theme; + gtkCfg = config.khanelinix.desktop.addons.gtk; greetdHyprlandConfig = pkgs.writeText "greetd-hyprland-config" '' ${cfg.hyprlandOutput} @@ -41,7 +42,7 @@ let ''; in { - options.${namespace}.display-managers.regreet = with types; { + options.khanelinix.display-managers.regreet = with types; { enable = mkBoolOpt false "Whether or not to enable greetd."; hyprlandOutput = mkOpt lines "" "Hyprlands Outputs config."; }; @@ -58,14 +59,14 @@ in settings = { background = { - path = pkgs.${namespace}.wallpapers.flatppuccin_macchiato; + path = self.packages.${system}.wallpapers.flatppuccin_macchiato; fit = "Cover"; }; GTK = { application_prefer_dark_theme = true; cursor_theme_name = "${themeCfg.cursor.name}"; - font_name = "${config.${namespace}.system.fonts.default} * 12"; + font_name = "${config.khanelinix.system.fonts.default} * 12"; icon_theme_name = "${themeCfg.icon.name}"; theme_name = "${gtkCfg.theme.name}"; }; diff --git a/modules/nixos/display-managers/sddm/default.nix b/modules/nixos/display-managers/sddm/default.nix index 462bfe2d2..4e5bdf3ea 100644 --- a/modules/nixos/display-managers/sddm/default.nix +++ b/modules/nixos/display-managers/sddm/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf getExe' stringAfter; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.display-managers.sddm; + cfg = config.khanelinix.display-managers.sddm; in { - options.${namespace}.display-managers.sddm = { + options.khanelinix.display-managers.sddm = { enable = mkBoolOpt false "Whether or not to enable sddm."; }; @@ -36,8 +36,8 @@ in stringAfter [ "users" ] # bash '' echo "Setting sddm permissions for user icon" - ${getExe' pkgs.acl "setfacl"} -m u:sddm:x /home/${config.${namespace}.user.name} - ${getExe' pkgs.acl "setfacl"} -m u:sddm:r /home/${config.${namespace}.user.name}/.face.icon || true + ${getExe' pkgs.acl "setfacl"} -m u:sddm:x /home/${config.khanelinix.user.name} + ${getExe' pkgs.acl "setfacl"} -m u:sddm:r /home/${config.khanelinix.user.name}/.face.icon || true ''; }; } diff --git a/modules/nixos/display-managers/tuigreet/default.nix b/modules/nixos/display-managers/tuigreet/default.nix index 82238190d..fc8165d8b 100644 --- a/modules/nixos/display-managers/tuigreet/default.nix +++ b/modules/nixos/display-managers/tuigreet/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf getExe; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.display-managers.tuigreet; + cfg = config.khanelinix.display-managers.tuigreet; in { - options.${namespace}.display-managers.tuigreet = { + options.khanelinix.display-managers.tuigreet = { enable = mkBoolOpt false "Whether or not to enable tuigreet."; }; diff --git a/modules/nixos/hardware/audio/default.nix b/modules/nixos/hardware/audio/default.nix index cb8feb668..62457127a 100644 --- a/modules/nixos/hardware/audio/default.nix +++ b/modules/nixos/hardware/audio/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) types mkIf mkForce; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.hardware.audio; + cfg = config.khanelinix.hardware.audio; in { - options.${namespace}.hardware.audio = with types; { + options.khanelinix.hardware.audio = with types; { enable = mkBoolOpt false "Whether or not to enable audio support."; alsa-monitor = mkOpt attrs { } "Alsa configuration."; extra-packages = mkOpt (listOf package) [ diff --git a/modules/nixos/hardware/bluetooth/default.nix b/modules/nixos/hardware/bluetooth/default.nix index a076d0a45..a8675bdde 100644 --- a/modules/nixos/hardware/bluetooth/default.nix +++ b/modules/nixos/hardware/bluetooth/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.hardware.bluetooth; + cfg = config.khanelinix.hardware.bluetooth; in { - options.${namespace}.hardware.bluetooth = { + options.khanelinix.hardware.bluetooth = { enable = mkBoolOpt false "Whether or not to enable support for extra bluetooth devices."; }; diff --git a/modules/nixos/hardware/cpu/amd/default.nix b/modules/nixos/hardware/cpu/amd/default.nix index 8ec324f6d..36b2a6a95 100644 --- a/modules/nixos/hardware/cpu/amd/default.nix +++ b/modules/nixos/hardware/cpu/amd/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.hardware.cpu.amd; + cfg = config.khanelinix.hardware.cpu.amd; in { - options.${namespace}.hardware.cpu.amd = { + options.khanelinix.hardware.cpu.amd = { enable = mkBoolOpt false "Whether or not to enable support for amd cpu."; }; diff --git a/modules/nixos/hardware/cpu/default.nix b/modules/nixos/hardware/cpu/default.nix index 1aeb1984d..e52df6385 100644 --- a/modules/nixos/hardware/cpu/default.nix +++ b/modules/nixos/hardware/cpu/default.nix @@ -1,9 +1,14 @@ -{ lib, namespace, ... }: +{ khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; in { - options.${namespace}.hardware.cpu = { + imports = [ + ./amd + ./intel + ]; + + options.khanelinix.hardware.cpu = { enable = mkBoolOpt false "No-op used for setting up hierarchy."; }; } diff --git a/modules/nixos/hardware/cpu/intel/default.nix b/modules/nixos/hardware/cpu/intel/default.nix index 0ea485a3b..2c17791af 100644 --- a/modules/nixos/hardware/cpu/intel/default.nix +++ b/modules/nixos/hardware/cpu/intel/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.hardware.cpu.intel; + cfg = config.khanelinix.hardware.cpu.intel; in { - options.${namespace}.hardware.cpu.intel = { + options.khanelinix.hardware.cpu.intel = { enable = mkBoolOpt false "Whether or not to enable support for intel cpu."; }; diff --git a/modules/nixos/hardware/default.nix b/modules/nixos/hardware/default.nix new file mode 100644 index 000000000..ae05f311e --- /dev/null +++ b/modules/nixos/hardware/default.nix @@ -0,0 +1,15 @@ +{ + imports = [ + ./audio + ./bluetooth + ./cpu + ./fingerprint + ./gpu + ./opengl + ./power + ./rgb + ./storage + ./tpm + ./yubikey + ]; +} diff --git a/modules/nixos/hardware/fingerprint/default.nix b/modules/nixos/hardware/fingerprint/default.nix index f61204dbb..428fb99ff 100644 --- a/modules/nixos/hardware/fingerprint/default.nix +++ b/modules/nixos/hardware/fingerprint/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.hardware.fingerprint; + cfg = config.khanelinix.hardware.fingerprint; in { - options.${namespace}.hardware.fingerprint = { + options.khanelinix.hardware.fingerprint = { enable = mkBoolOpt false "Whether or not to enable fingerprint support."; }; diff --git a/modules/nixos/hardware/gpu/amd/default.nix b/modules/nixos/hardware/gpu/amd/default.nix index 650f35578..9e17f4ea3 100644 --- a/modules/nixos/hardware/gpu/amd/default.nix +++ b/modules/nixos/hardware/gpu/amd/default.nix @@ -1,18 +1,18 @@ { config, + khanelinix-lib, lib, pkgs, - namespace, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.hardware.gpu.amd; + cfg = config.khanelinix.hardware.gpu.amd; in { - options.${namespace}.hardware.gpu.amd = { + options.khanelinix.hardware.gpu.amd = { enable = mkBoolOpt false "Whether or not to enable support for amdgpu."; }; diff --git a/modules/nixos/hardware/gpu/default.nix b/modules/nixos/hardware/gpu/default.nix index 85af8ba68..ffab4d1f5 100644 --- a/modules/nixos/hardware/gpu/default.nix +++ b/modules/nixos/hardware/gpu/default.nix @@ -1,9 +1,9 @@ -{ lib, namespace, ... }: +{ khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; in { - options.${namespace}.hardware.gpu = { + options.khanelinix.hardware.gpu = { enable = mkBoolOpt false "No-op for setting up hierarchy."; }; } diff --git a/modules/nixos/hardware/gpu/nvidia/default.nix b/modules/nixos/hardware/gpu/nvidia/default.nix index f6a054115..4c0993733 100644 --- a/modules/nixos/hardware/gpu/nvidia/default.nix +++ b/modules/nixos/hardware/gpu/nvidia/default.nix @@ -1,14 +1,14 @@ { config, + khanelinix-lib, lib, pkgs, - namespace, ... }: let inherit (lib) mkDefault mkIf versionOlder; - inherit (lib.${namespace}) mkBoolOpt; - cfg = config.${namespace}.hardware.gpu.nvidia; + inherit (khanelinix-lib) mkBoolOpt; + cfg = config.khanelinix.hardware.gpu.nvidia; # use the latest possible nvidia package nvStable = config.boot.kernelPackages.nvidiaPackages.stable.version; @@ -21,7 +21,7 @@ let config.boot.kernelPackages.nvidiaPackages.beta; in { - options.${namespace}.hardware.gpu.nvidia = { + options.khanelinix.hardware.gpu.nvidia = { enable = mkBoolOpt false "Whether or not to enable support for nvidia."; }; @@ -44,7 +44,7 @@ in ]; hardware = { - nvidia = mkIf (!config.${namespace}.hardware.gpu.amd.enable) { + nvidia = mkIf (!config.khanelinix.hardware.gpu.amd.enable) { package = mkDefault nvidiaPackage; modesetting.enable = mkDefault true; diff --git a/modules/nixos/hardware/opengl/default.nix b/modules/nixos/hardware/opengl/default.nix index 5c9d23627..35273c3f4 100644 --- a/modules/nixos/hardware/opengl/default.nix +++ b/modules/nixos/hardware/opengl/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.hardware.opengl; + cfg = config.khanelinix.hardware.opengl; in { - options.${namespace}.hardware.opengl = { + options.khanelinix.hardware.opengl = { enable = mkBoolOpt false "Whether or not to enable support for opengl."; }; diff --git a/modules/nixos/hardware/power/default.nix b/modules/nixos/hardware/power/default.nix index a815f503c..ad87e76d8 100644 --- a/modules/nixos/hardware/power/default.nix +++ b/modules/nixos/hardware/power/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.hardware.power; + cfg = config.khanelinix.hardware.power; in { - options.${namespace}.hardware.power = { + options.khanelinix.hardware.power = { enable = mkBoolOpt false "Whether or not to enable support for extra power devices."; }; diff --git a/modules/nixos/hardware/rgb/ckb-next/default.nix b/modules/nixos/hardware/rgb/ckb-next/default.nix index 0b9c00e4b..15485bcf2 100644 --- a/modules/nixos/hardware/rgb/ckb-next/default.nix +++ b/modules/nixos/hardware/rgb/ckb-next/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) types mkIf; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.hardware.rgb.ckb-next; + cfg = config.khanelinix.hardware.rgb.ckb-next; in { - options.${namespace}.hardware.rgb.ckb-next = with types; { + options.khanelinix.hardware.rgb.ckb-next = with types; { enable = mkBoolOpt false "Whether or not to enable support for rgb controls."; ckbNextConfig = mkOpt (nullOr path) null "The ckb-next.conf file to create."; }; @@ -19,7 +19,7 @@ in config = mkIf cfg.enable { hardware.ckb-next.enable = true; - ${namespace}.home.configFile = + khanelinix.home.configFile = { } // lib.optionalAttrs (cfg.ckbNextConfig != null) { "ckb-next/ckb-next.cfg".source = cfg.ckbNextConfig; diff --git a/modules/nixos/hardware/rgb/default.nix b/modules/nixos/hardware/rgb/default.nix new file mode 100644 index 000000000..271d73e3b --- /dev/null +++ b/modules/nixos/hardware/rgb/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./ckb-next + ./openrgb + ]; +} diff --git a/modules/nixos/hardware/rgb/openrgb/default.nix b/modules/nixos/hardware/rgb/openrgb/default.nix index 78d37c5b3..509435f6a 100644 --- a/modules/nixos/hardware/rgb/openrgb/default.nix +++ b/modules/nixos/hardware/rgb/openrgb/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) types mkIf mkOption; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.hardware.rgb.openrgb; + cfg = config.khanelinix.hardware.rgb.openrgb; in { - options.${namespace}.hardware.rgb.openrgb = with types; { + options.khanelinix.hardware.rgb.openrgb = with types; { enable = mkBoolOpt false "Whether or not to enable support for rgb controls."; motherboard = mkOption { type = types.nullOr ( @@ -33,7 +33,7 @@ in openrgb-with-all-plugins ]; - ${namespace}.home.configFile = + khanelinix.home.configFile = { } // lib.optionalAttrs (cfg.openRGBConfig != null) { "OpenRGB/sizes.ors".source = cfg.openRGBConfig + "/sizes.ors"; diff --git a/modules/nixos/hardware/storage/btrfs/default.nix b/modules/nixos/hardware/storage/btrfs/default.nix index bc8b8155b..4f57ea859 100644 --- a/modules/nixos/hardware/storage/btrfs/default.nix +++ b/modules/nixos/hardware/storage/btrfs/default.nix @@ -2,7 +2,7 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let @@ -12,10 +12,10 @@ let genAttrs getExe ; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; inherit (cfg) dedupeFilesystems; - cfg = config.${namespace}.hardware.storage.btrfs; + cfg = config.khanelinix.hardware.storage.btrfs; dedupeFilesystemsAttrSets = genAttrs dedupeFilesystems (name: { spec = "LABEL=${name}"; @@ -31,7 +31,7 @@ let }); in { - options.${namespace}.hardware.storage.btrfs = with types; { + options.khanelinix.hardware.storage.btrfs = with types; { enable = mkBoolOpt false "Whether or not to enable support for btrfs devices."; autoScrub = mkBoolOpt false "Whether to enable btrfs autoScrub;"; dedupe = mkBoolOpt false "Whether to enable btrfs deduplication;"; diff --git a/modules/nixos/hardware/storage/default.nix b/modules/nixos/hardware/storage/default.nix index ae3ab204f..8b9d1a6eb 100644 --- a/modules/nixos/hardware/storage/default.nix +++ b/modules/nixos/hardware/storage/default.nix @@ -2,17 +2,22 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.hardware.storage; + cfg = config.khanelinix.hardware.storage; in { - options.${namespace}.hardware.storage = { + imports = [ + ./btrfs + ./zfs + ]; + + options.khanelinix.hardware.storage = { enable = mkBoolOpt false "Whether or not to enable support for extra storage devices."; ssdEnable = mkBoolOpt true "Whether or not to enable support for SSD storage devices."; }; diff --git a/modules/nixos/hardware/storage/zfs/default.nix b/modules/nixos/hardware/storage/zfs/default.nix index ba18d26f6..abf8fff46 100644 --- a/modules/nixos/hardware/storage/zfs/default.nix +++ b/modules/nixos/hardware/storage/zfs/default.nix @@ -1,18 +1,18 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkEnableOption mkIf mkDefault; - inherit (lib.${namespace}) mkOpt; + inherit (khanelinix-lib) mkOpt; inherit (lib.types) listOf str; - cfg = config.${namespace}.hardware.storage.zfs; + cfg = config.khanelinix.hardware.storage.zfs; in { - options.${namespace}.hardware.storage.zfs = { + options.khanelinix.hardware.storage.zfs = { enable = mkEnableOption "ZFS support"; auto-snapshot = { enable = mkEnableOption "ZFS auto snapshotting"; diff --git a/modules/nixos/hardware/tpm/default.nix b/modules/nixos/hardware/tpm/default.nix index 5dc8231e8..e4302d6ec 100644 --- a/modules/nixos/hardware/tpm/default.nix +++ b/modules/nixos/hardware/tpm/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkDefault mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.hardware.tpm; + cfg = config.khanelinix.hardware.tpm; in { - options.${namespace}.hardware.tpm = { + options.khanelinix.hardware.tpm = { enable = mkBoolOpt false "Whether or not to enable Trusted Platform Module 2 (TPM2)."; }; diff --git a/modules/nixos/hardware/yubikey/default.nix b/modules/nixos/hardware/yubikey/default.nix index 917409b37..6a2ee8f5d 100644 --- a/modules/nixos/hardware/yubikey/default.nix +++ b/modules/nixos/hardware/yubikey/default.nix @@ -2,14 +2,14 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf getExe'; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.hardware.yubikey; + cfg = config.khanelinix.hardware.yubikey; reload-yubikey = pkgs.writeShellScriptBin "reload-yubikey" # bash @@ -18,7 +18,7 @@ let ''; in { - options.${namespace}.hardware.yubikey = { + options.khanelinix.hardware.yubikey = { enable = mkBoolOpt false "Whether or not to enable Yubikey."; enableSSHSupport = mkBoolOpt false "Whether or not to enable SSH support for Yubikey."; }; diff --git a/modules/nixos/home/default.nix b/modules/nixos/home/default.nix index 7f1cf249e..6128c1fc5 100644 --- a/modules/nixos/home/default.nix +++ b/modules/nixos/home/default.nix @@ -1,17 +1,21 @@ { config, + khanelinix-lib, lib, options, - namespace, + inputs, ... }: let inherit (lib) types mkAliasDefinitions; - inherit (lib.${namespace}) mkOpt; + inherit (khanelinix-lib) mkOpt; in { + imports = lib.optional ( + inputs.home-manager ? nixosModules + ) inputs.home-manager.nixosModules.home-manager; - options.${namespace}.home = with types; { + options.khanelinix.home = with types; { configFile = mkOpt attrs { } "A set of files to be managed by home-manager's ."; @@ -19,11 +23,11 @@ in file = mkOpt attrs { } "A set of files to be managed by home-manager's ."; }; - config = { - ${namespace}.home.extraOptions = { - home.file = mkAliasDefinitions options.${namespace}.home.file; + config = lib.optionalAttrs (inputs.home-manager ? nixosModules) { + khanelinix.home.extraOptions = { + home.file = mkAliasDefinitions options.khanelinix.home.file; home.stateVersion = config.system.stateVersion; - xdg.configFile = mkAliasDefinitions options.${namespace}.home.configFile; + xdg.configFile = mkAliasDefinitions options.khanelinix.home.configFile; xdg.enable = true; }; @@ -34,7 +38,7 @@ in useGlobalPkgs = true; useUserPackages = true; - users.${config.${namespace}.user.name} = mkAliasDefinitions options.${namespace}.home.extraOptions; + users.${config.khanelinix.user.name} = mkAliasDefinitions options.khanelinix.home.extraOptions; verbose = true; }; diff --git a/modules/nixos/nix/default.nix b/modules/nixos/nix/default.nix index 79b64d1e1..49a8482a1 100644 --- a/modules/nixos/nix/default.nix +++ b/modules/nixos/nix/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + root, ... }: let inherit (lib) mkDefault mkIf; - cfg = config.${namespace}.nix; + cfg = config.khanelinix.nix; in { - imports = [ (lib.snowfall.fs.get-file "modules/shared/nix/default.nix") ]; + imports = [ (root + "/modules/shared/nix/default.nix") ]; config = mkIf cfg.enable { documentation = { diff --git a/modules/nixos/programs/default.nix b/modules/nixos/programs/default.nix new file mode 100644 index 000000000..35abed499 --- /dev/null +++ b/modules/nixos/programs/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./graphical + ./terminal + ]; +} diff --git a/modules/nixos/programs/graphical/addons/default.nix b/modules/nixos/programs/graphical/addons/default.nix new file mode 100644 index 000000000..2f6d1ed0e --- /dev/null +++ b/modules/nixos/programs/graphical/addons/default.nix @@ -0,0 +1,10 @@ +{ + imports = [ + ./gamemode + ./gamescope + ./keyring + ./looking-glass-client + ./noisetorch + ./xdg-portal + ]; +} diff --git a/modules/nixos/programs/graphical/addons/gamemode/default.nix b/modules/nixos/programs/graphical/addons/gamemode/default.nix index 5c824d75f..3ac221338 100644 --- a/modules/nixos/programs/graphical/addons/gamemode/default.nix +++ b/modules/nixos/programs/graphical/addons/gamemode/default.nix @@ -2,13 +2,13 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.programs.graphical.addons.gamemode; + cfg = config.khanelinix.programs.graphical.addons.gamemode; defaultStartScript = '' ${lib.getExe' pkgs.libnotify "notify-send"} 'GameMode started' @@ -19,7 +19,7 @@ let ''; in { - options.${namespace}.programs.graphical.addons.gamemode = with lib.types; { + options.khanelinix.programs.graphical.addons.gamemode = with lib.types; { enable = mkBoolOpt false "Whether or not to enable gamemode."; endscript = mkOpt (nullOr str) null "The script to run when disabling gamemode."; startscript = mkOpt (nullOr str) null "The script to run when enabling gamemode."; diff --git a/modules/nixos/programs/graphical/addons/gamescope/default.nix b/modules/nixos/programs/graphical/addons/gamescope/default.nix index ecf9db6d2..2eaec59e7 100644 --- a/modules/nixos/programs/graphical/addons/gamescope/default.nix +++ b/modules/nixos/programs/graphical/addons/gamescope/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) getExe mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.addons.gamescope; + cfg = config.khanelinix.programs.graphical.addons.gamescope; in { - options.${namespace}.programs.graphical.addons.gamescope = { + options.khanelinix.programs.graphical.addons.gamescope = { enable = mkBoolOpt false "Whether or not to enable gamescope."; }; diff --git a/modules/nixos/programs/graphical/addons/keyring/default.nix b/modules/nixos/programs/graphical/addons/keyring/default.nix index 48d08491f..1c248361a 100644 --- a/modules/nixos/programs/graphical/addons/keyring/default.nix +++ b/modules/nixos/programs/graphical/addons/keyring/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.addons.keyring; + cfg = config.khanelinix.programs.graphical.addons.keyring; in { - options.${namespace}.programs.graphical.addons.keyring = { + options.khanelinix.programs.graphical.addons.keyring = { enable = mkBoolOpt false "Whether to enable the passwords application."; }; diff --git a/modules/nixos/programs/graphical/addons/looking-glass-client/default.nix b/modules/nixos/programs/graphical/addons/looking-glass-client/default.nix index 0ef5cee5e..bb320aa21 100644 --- a/modules/nixos/programs/graphical/addons/looking-glass-client/default.nix +++ b/modules/nixos/programs/graphical/addons/looking-glass-client/default.nix @@ -2,18 +2,18 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; - inherit (config.${namespace}) user; + inherit (khanelinix-lib) mkBoolOpt; + inherit (config.khanelinix) user; - cfg = config.${namespace}.programs.graphical.addons.looking-glass-client; + cfg = config.khanelinix.programs.graphical.addons.looking-glass-client; in { - options.${namespace}.programs.graphical.addons.looking-glass-client = { + options.khanelinix.programs.graphical.addons.looking-glass-client = { enable = mkBoolOpt false "Whether or not to enable the Looking Glass client."; }; diff --git a/modules/nixos/programs/graphical/addons/noisetorch/default.nix b/modules/nixos/programs/graphical/addons/noisetorch/default.nix index 98e73fa7a..d1d412ca3 100644 --- a/modules/nixos/programs/graphical/addons/noisetorch/default.nix +++ b/modules/nixos/programs/graphical/addons/noisetorch/default.nix @@ -2,7 +2,7 @@ config, lib, pkgs, - namespace, + ... }: let @@ -14,10 +14,10 @@ let types ; - cfg = config.${namespace}.programs.graphical.addons.noisetorch; + cfg = config.khanelinix.programs.graphical.addons.noisetorch; in { - options.${namespace}.programs.graphical.addons.noisetorch = { + options.khanelinix.programs.graphical.addons.noisetorch = { enable = mkEnableOption "noisetorch service"; package = mkOption { type = types.package; diff --git a/modules/nixos/programs/graphical/addons/xdg-portal/default.nix b/modules/nixos/programs/graphical/addons/xdg-portal/default.nix index 6a0dcfdf8..aac094ef4 100644 --- a/modules/nixos/programs/graphical/addons/xdg-portal/default.nix +++ b/modules/nixos/programs/graphical/addons/xdg-portal/default.nix @@ -4,18 +4,18 @@ lib, pkgs, system, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; inherit (inputs) hyprland; - cfg = config.${namespace}.programs.graphical.addons.xdg-portal; + cfg = config.khanelinix.programs.graphical.addons.xdg-portal; in { - options.${namespace}.programs.graphical.addons.xdg-portal = { + options.khanelinix.programs.graphical.addons.xdg-portal = { enable = mkBoolOpt false "Whether or not to add support for xdg portal."; }; @@ -24,12 +24,12 @@ in portal = { enable = true; - configPackages = lib.optionals config.${namespace}.programs.graphical.wms.hyprland.enable [ + configPackages = lib.optionals config.khanelinix.programs.graphical.wms.hyprland.enable [ hyprland.packages.${system}.hyprland ]; config = { - hyprland = mkIf config.${namespace}.programs.graphical.wms.hyprland.enable { + hyprland = mkIf config.khanelinix.programs.graphical.wms.hyprland.enable { default = [ "hyprland" "gtk" @@ -38,7 +38,7 @@ in "org.freedesktop.impl.portal.Screenshot" = "hyprland"; }; - sway = mkIf config.${namespace}.programs.graphical.wms.sway.enable { + sway = mkIf config.khanelinix.programs.graphical.wms.sway.enable { default = lib.mkDefault [ "wlr" "gtk" @@ -59,8 +59,8 @@ in extraPortals = with pkgs; [ xdg-desktop-portal-gtk ] - ++ (lib.optional config.${namespace}.programs.graphical.wms.sway.enable xdg-desktop-portal-wlr) - ++ (lib.optional config.${namespace}.programs.graphical.wms.hyprland.enable ( + ++ (lib.optional config.khanelinix.programs.graphical.wms.sway.enable xdg-desktop-portal-wlr) + ++ (lib.optional config.khanelinix.programs.graphical.wms.hyprland.enable ( hyprland.packages.${system}.xdg-desktop-portal-hyprland.override { debug = true; # TODO: use same package as home-manager @@ -70,7 +70,7 @@ in # xdgOpenUsePortal = true; wlr = { - inherit (config.${namespace}.programs.graphical.wms.sway) enable; + inherit (config.khanelinix.programs.graphical.wms.sway) enable; settings = { screencast = { diff --git a/modules/nixos/programs/graphical/apps/_1password/default.nix b/modules/nixos/programs/graphical/apps/_1password/default.nix index 3870d3e5e..2570ada5a 100644 --- a/modules/nixos/programs/graphical/apps/_1password/default.nix +++ b/modules/nixos/programs/graphical/apps/_1password/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.programs.graphical.apps._1password; + cfg = config.khanelinix.programs.graphical.apps._1password; in { - options.${namespace}.programs.graphical.apps._1password = { + options.khanelinix.programs.graphical.apps._1password = { enable = mkBoolOpt false "Whether or not to enable 1password."; enableSshSocket = mkBoolOpt false "Whether or not to enable ssh-agent socket."; }; @@ -24,7 +24,7 @@ in enable = true; package = pkgs._1password-gui; - polkitPolicyOwners = [ config.${namespace}.user.name ]; + polkitPolicyOwners = [ config.khanelinix.user.name ]; }; ssh.extraConfig = lib.optionalString cfg.enableSshSocket '' diff --git a/modules/nixos/programs/graphical/apps/default.nix b/modules/nixos/programs/graphical/apps/default.nix new file mode 100644 index 000000000..185cfc5c9 --- /dev/null +++ b/modules/nixos/programs/graphical/apps/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./_1password + ./partitionmanager + ./steam + ./virtualbox + ]; +} diff --git a/modules/nixos/programs/graphical/apps/partitionmanager/default.nix b/modules/nixos/programs/graphical/apps/partitionmanager/default.nix index d3c6c427c..6c0000a97 100644 --- a/modules/nixos/programs/graphical/apps/partitionmanager/default.nix +++ b/modules/nixos/programs/graphical/apps/partitionmanager/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.apps.partitionmanager; + cfg = config.khanelinix.programs.graphical.apps.partitionmanager; in { - options.${namespace}.programs.graphical.apps.partitionmanager = { + options.khanelinix.programs.graphical.apps.partitionmanager = { enable = mkBoolOpt false "Whether or not to enable partitionmanager."; }; diff --git a/modules/nixos/programs/graphical/apps/steam/default.nix b/modules/nixos/programs/graphical/apps/steam/default.nix index 753786f6c..0a2937c14 100644 --- a/modules/nixos/programs/graphical/apps/steam/default.nix +++ b/modules/nixos/programs/graphical/apps/steam/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.apps.steam; + cfg = config.khanelinix.programs.graphical.apps.steam; in { - options.${namespace}.programs.graphical.apps.steam = { + options.khanelinix.programs.graphical.apps.steam = { enable = mkBoolOpt false "Whether or not to enable support for Steam."; }; diff --git a/modules/nixos/programs/graphical/apps/virtualbox/default.nix b/modules/nixos/programs/graphical/apps/virtualbox/default.nix index 393d89528..baea3c205 100644 --- a/modules/nixos/programs/graphical/apps/virtualbox/default.nix +++ b/modules/nixos/programs/graphical/apps/virtualbox/default.nix @@ -1,22 +1,22 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.apps.virtualbox; + cfg = config.khanelinix.programs.graphical.apps.virtualbox; in { - options.${namespace}.programs.graphical.apps.virtualbox = { + options.khanelinix.programs.graphical.apps.virtualbox = { enable = mkBoolOpt false "Whether or not to enable Virtualbox."; }; config = mkIf cfg.enable { - ${namespace}.user.extraGroups = [ "vboxusers" ]; + khanelinix.user.extraGroups = [ "vboxusers" ]; virtualisation.virtualbox.host = { enable = true; diff --git a/modules/nixos/programs/graphical/default.nix b/modules/nixos/programs/graphical/default.nix new file mode 100644 index 000000000..f69c3182e --- /dev/null +++ b/modules/nixos/programs/graphical/default.nix @@ -0,0 +1,9 @@ +{ + imports = [ + ./addons + ./apps + ./desktop-environment + ./file-managers + ./wms + ]; +} diff --git a/modules/nixos/programs/graphical/desktop-environment/default.nix b/modules/nixos/programs/graphical/desktop-environment/default.nix new file mode 100644 index 000000000..7c1002ba2 --- /dev/null +++ b/modules/nixos/programs/graphical/desktop-environment/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./gnome + ]; +} diff --git a/modules/nixos/programs/graphical/desktop-environment/gnome/default.nix b/modules/nixos/programs/graphical/desktop-environment/gnome/default.nix index 0726e8292..126889b6a 100644 --- a/modules/nixos/programs/graphical/desktop-environment/gnome/default.nix +++ b/modules/nixos/programs/graphical/desktop-environment/gnome/default.nix @@ -2,7 +2,9 @@ config, lib, pkgs, - namespace, + khanelinix-lib, + self, + system, ... }: let @@ -10,17 +12,16 @@ let types mkIf mapAttrs - optional getExe mkDefault ; - inherit (lib.${namespace}) + inherit (khanelinix-lib) enabled mkBoolOpt mkOpt ; - cfg = config.${namespace}.programs.graphical.desktop-environment.gnome; + cfg = config.khanelinix.programs.graphical.desktop-environment.gnome; gdmHome = config.users.users.gdm.home; defaultExtensions = with pkgs.gnomeExtensions; [ @@ -43,7 +44,7 @@ let nested-default-attrs = mapAttrs (_key: default-attrs); in { - options.${namespace}.programs.graphical.desktop-environment.gnome = with types; { + options.khanelinix.programs.graphical.desktop-environment.gnome = with types; { enable = mkBoolOpt false "Whether or not to use Gnome as the desktop environment."; color-scheme = mkOpt (enum [ "light" @@ -56,11 +57,11 @@ in light = mkOpt (oneOf [ str package - ]) pkgs.${namespace}.wallpapers.flatppuccin_macchiato "The light wallpaper to use."; + ]) self.packages.${system}.wallpapers.flatppuccin_macchiato "The light wallpaper to use."; dark = mkOpt (oneOf [ str package - ]) pkgs.${namespace}.wallpapers.cat-sound "The dark wallpaper to use."; + ]) self.packages.${system}.wallpapers.cat-sound "The dark wallpaper to use."; }; wayland = mkBoolOpt true "Whether or not to use Wayland."; }; @@ -118,15 +119,15 @@ in favorite-apps = [ "org.gnome.Nautilus.desktop" ] # FIX: references - # ++ optional config.${namespace}.programs.graphical.firefox.enable "firefox.desktop" - # ++ optional config.${namespace}.programs.graphical.vscode.enable "code.desktop" - # ++ optional config.${namespace}.programs.terminal.emulators.foot.enable "foot.desktop" - # ++ optional config.${namespace}.programs.terminal.emulators.kitty.enable "kitty.desktop" + # ++ optional config.khanelinix.programs.graphical.firefox.enable "firefox.desktop" + # ++ optional config.khanelinix.programs.graphical.vscode.enable "code.desktop" + # ++ optional config.khanelinix.programs.terminal.emulators.foot.enable "foot.desktop" + # ++ optional config.khanelinix.programs.terminal.emulators.kitty.enable "kitty.desktop" ++ [ "org.gnome.Console.desktop" ]; # FIX: references - # ++ optional config.${namespace}.programs.graphical.logseq.enable "logseq.desktop" - # ++ optional config.${namespace}.programs.graphical.apps.discord.enable "discord.desktop" - # ++ optional config.${namespace}.programs.graphical.apps.steam.enable "steam.desktop"; + # ++ optional config.khanelinix.programs.graphical.logseq.enable "logseq.desktop" + # ++ optional config.khanelinix.programs.graphical.apps.discord.enable "discord.desktop" + # ++ optional config.khanelinix.programs.graphical.apps.steam.enable "steam.desktop"; }; "org/gnome/desktop/background" = { @@ -213,8 +214,8 @@ in menu-button-icon-image = 23; menu-button-terminal = - # if config.${namespace}.desktop.addons.term.enable then - # getExe config.${namespace}.desktop.addons.term.pkg + # if config.khanelinix.desktop.addons.term.enable then + # getExe config.khanelinix.desktop.addons.term.pkg # else getExe pkgs.gnome-terminal; }; @@ -275,7 +276,7 @@ in }; "org/gnome/shell/extensions/user-theme" = { - inherit (config.${namespace}.theme.gtk.theme) name; + inherit (config.khanelinix.theme.gtk.theme) name; }; }; }; @@ -311,7 +312,7 @@ in lib.optional (cfg.monitors != null) "L+ ${gdmHome}/.config/monitors.xml - - - - ${cfg.monitors}" ); - # services."${namespace}-user-icon" = { + # services."khanelinix-user-icon" = { # before = [ "display-manager.service" ]; # wantedBy = [ "display-manager.service" ]; # @@ -323,9 +324,9 @@ in # # script = # bash # '' - # config_file=/var/lib/AccountsService/users/${config.${namespace}.user.name} - # icon_file=/run/current-system/sw/share/${namespace}.icons/user/${config.${namespace}.user.name}/${ - # config.${namespace}.user.icon.fileName + # config_file=/var/lib/AccountsService/users/${config.khanelinix.user.name} + # icon_file=/run/current-system/sw/share/khanelinix.icons/user/${config.khanelinix.user.name}/${ + # config.khanelinix.user.icon.fileName # } # # if ! [ -d "$(dirname "$config_file")"]; then diff --git a/modules/nixos/programs/graphical/file-managers/default.nix b/modules/nixos/programs/graphical/file-managers/default.nix new file mode 100644 index 000000000..19070d8a2 --- /dev/null +++ b/modules/nixos/programs/graphical/file-managers/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./dolphin + ./nautilus + ./thunar + ]; +} diff --git a/modules/nixos/programs/graphical/file-managers/dolphin/default.nix b/modules/nixos/programs/graphical/file-managers/dolphin/default.nix index 19a3c2fed..63943b309 100644 --- a/modules/nixos/programs/graphical/file-managers/dolphin/default.nix +++ b/modules/nixos/programs/graphical/file-managers/dolphin/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.file-managers.dolphin; + cfg = config.khanelinix.programs.graphical.file-managers.dolphin; in { - options.${namespace}.programs.graphical.file-managers.dolphin = { + options.khanelinix.programs.graphical.file-managers.dolphin = { enable = mkBoolOpt false "Whether or not to enable Dolphin."; }; diff --git a/modules/nixos/programs/graphical/file-managers/nautilus/default.nix b/modules/nixos/programs/graphical/file-managers/nautilus/default.nix index ea52b2e5a..d5b316889 100644 --- a/modules/nixos/programs/graphical/file-managers/nautilus/default.nix +++ b/modules/nixos/programs/graphical/file-managers/nautilus/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.file-managers.nautilus; + cfg = config.khanelinix.programs.graphical.file-managers.nautilus; in { - options.${namespace}.programs.graphical.file-managers.nautilus = { + options.khanelinix.programs.graphical.file-managers.nautilus = { enable = mkBoolOpt false "Whether to enable the gnome file manager."; }; diff --git a/modules/nixos/programs/graphical/file-managers/thunar/default.nix b/modules/nixos/programs/graphical/file-managers/thunar/default.nix index f574c82b4..e2619854f 100644 --- a/modules/nixos/programs/graphical/file-managers/thunar/default.nix +++ b/modules/nixos/programs/graphical/file-managers/thunar/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.graphical.file-managers.thunar; + cfg = config.khanelinix.programs.graphical.file-managers.thunar; in { - options.${namespace}.programs.graphical.file-managers.thunar = { + options.khanelinix.programs.graphical.file-managers.thunar = { enable = mkBoolOpt false "Whether to enable the xfce file manager."; }; diff --git a/modules/nixos/programs/graphical/wms/default.nix b/modules/nixos/programs/graphical/wms/default.nix new file mode 100644 index 000000000..83e551094 --- /dev/null +++ b/modules/nixos/programs/graphical/wms/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./hyprland + ./sway + ]; +} diff --git a/modules/nixos/programs/graphical/wms/hyprland/default.nix b/modules/nixos/programs/graphical/wms/hyprland/default.nix index 66e94c749..3a3a418f6 100644 --- a/modules/nixos/programs/graphical/wms/hyprland/default.nix +++ b/modules/nixos/programs/graphical/wms/hyprland/default.nix @@ -4,7 +4,7 @@ lib, pkgs, system, - namespace, + khanelinix-lib, ... }: let @@ -14,10 +14,10 @@ let mkIf types ; - inherit (lib.${namespace}) mkBoolOpt mkOpt enabled; + inherit (khanelinix-lib) mkBoolOpt mkOpt enabled; inherit (inputs) hyprland; - cfg = config.${namespace}.programs.graphical.wms.hyprland; + cfg = config.khanelinix.programs.graphical.wms.hyprland; programs = makeBinPath ( with pkgs; @@ -32,7 +32,7 @@ let ); in { - options.${namespace}.programs.graphical.wms.hyprland = with types; { + options.khanelinix.programs.graphical.wms.hyprland = with types; { enable = mkBoolOpt false "Whether or not to enable Hyprland."; customConfigFiles = mkOpt attrs { } @@ -51,8 +51,8 @@ in ''; sessionVariables = { - HYPRCURSOR_THEME = config.${namespace}.theme.cursor.name; - HYPRCURSOR_SIZE = "${toString config.${namespace}.theme.cursor.size}"; + HYPRCURSOR_THEME = config.khanelinix.theme.cursor.name; + HYPRCURSOR_SIZE = "${toString config.khanelinix.theme.cursor.size}"; }; }; diff --git a/modules/nixos/programs/graphical/wms/sway/default.nix b/modules/nixos/programs/graphical/wms/sway/default.nix index f98ae397e..fd476a31e 100644 --- a/modules/nixos/programs/graphical/wms/sway/default.nix +++ b/modules/nixos/programs/graphical/wms/sway/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) types mkIf; - inherit (lib.${namespace}) mkBoolOpt mkOpt enabled; + inherit (khanelinix-lib) mkBoolOpt mkOpt enabled; - cfg = config.${namespace}.programs.graphical.wms.sway; + cfg = config.khanelinix.programs.graphical.wms.sway; in { - options.${namespace}.programs.graphical.wms.sway = with types; { + options.khanelinix.programs.graphical.wms.sway = with types; { enable = mkBoolOpt false "Whether or not to enable Sway."; extraConfig = mkOpt str "" "Additional configuration for the Sway config file."; wallpaper = mkOpt (nullOr package) null "The wallpaper to display."; diff --git a/modules/nixos/programs/terminal/default.nix b/modules/nixos/programs/terminal/default.nix new file mode 100644 index 000000000..9753b32f7 --- /dev/null +++ b/modules/nixos/programs/terminal/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./tools + ]; +} diff --git a/modules/nixos/programs/terminal/tools/bandwhich/default.nix b/modules/nixos/programs/terminal/tools/bandwhich/default.nix index fc47ef8e4..df5f81677 100644 --- a/modules/nixos/programs/terminal/tools/bandwhich/default.nix +++ b/modules/nixos/programs/terminal/tools/bandwhich/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.bandwhich; + cfg = config.khanelinix.programs.terminal.tools.bandwhich; in { - options.${namespace}.programs.terminal.tools.bandwhich = { + options.khanelinix.programs.terminal.tools.bandwhich = { enable = mkBoolOpt false "Whether or not to enable bandwhich."; }; diff --git a/modules/nixos/programs/terminal/tools/default.nix b/modules/nixos/programs/terminal/tools/default.nix new file mode 100644 index 000000000..cdd83d385 --- /dev/null +++ b/modules/nixos/programs/terminal/tools/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./bandwhich + ./nix-ld + ./qmk + ./ssh + ]; +} diff --git a/modules/nixos/programs/terminal/tools/nix-ld/default.nix b/modules/nixos/programs/terminal/tools/nix-ld/default.nix index 965237982..46d3b2b34 100644 --- a/modules/nixos/programs/terminal/tools/nix-ld/default.nix +++ b/modules/nixos/programs/terminal/tools/nix-ld/default.nix @@ -1,18 +1,18 @@ { config, lib, - namespace, + khanelinix-lib, pkgs, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.programs.terminal.tools.nix-ld; + cfg = config.khanelinix.programs.terminal.tools.nix-ld; in { - options.${namespace}.programs.terminal.tools.nix-ld = { + options.khanelinix.programs.terminal.tools.nix-ld = { enable = mkBoolOpt false "Whether or not to enable nix-ld."; }; diff --git a/modules/nixos/programs/terminal/tools/qmk/default.nix b/modules/nixos/programs/terminal/tools/qmk/default.nix index 10a8cba1e..b75e4a508 100644 --- a/modules/nixos/programs/terminal/tools/qmk/default.nix +++ b/modules/nixos/programs/terminal/tools/qmk/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.tools.qmk; + cfg = config.khanelinix.tools.qmk; in { - options.${namespace}.tools.qmk = { + options.khanelinix.tools.qmk = { enable = mkBoolOpt false "Whether or not to enable QMK"; }; diff --git a/modules/nixos/programs/terminal/tools/ssh/default.nix b/modules/nixos/programs/terminal/tools/ssh/default.nix index 0475d4404..5303503b1 100644 --- a/modules/nixos/programs/terminal/tools/ssh/default.nix +++ b/modules/nixos/programs/terminal/tools/ssh/default.nix @@ -1,7 +1,7 @@ { - lib, + root, ... }: { - imports = [ (lib.snowfall.fs.get-file "modules/shared/programs/terminal/tools/ssh/default.nix") ]; + imports = [ (root + "/modules/shared/programs/terminal/tools/ssh/default.nix") ]; } diff --git a/modules/nixos/security/acme/default.nix b/modules/nixos/security/acme/default.nix index d6c855bb4..880546ac4 100644 --- a/modules/nixos/security/acme/default.nix +++ b/modules/nixos/security/acme/default.nix @@ -2,18 +2,18 @@ config, lib, virtual, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkOpt; + inherit (khanelinix-lib) mkOpt; - cfg = config.${namespace}.security.acme; + cfg = config.khanelinix.security.acme; in { - options.${namespace}.security.acme = { + options.khanelinix.security.acme = { enable = lib.mkEnableOption "default ACME configuration"; - email = mkOpt lib.types.str config.${namespace}.user.email "The email to use."; + email = mkOpt lib.types.str config.khanelinix.user.email "The email to use."; staging = mkOpt lib.types.bool virtual "Whether to use the staging server or not."; }; diff --git a/modules/nixos/security/auditd/default.nix b/modules/nixos/security/auditd/default.nix index 914a10be1..ef7e3693a 100644 --- a/modules/nixos/security/auditd/default.nix +++ b/modules/nixos/security/auditd/default.nix @@ -1,14 +1,14 @@ { config, lib, - namespace, + ... }: let - cfg = config.${namespace}.security.auditd; + cfg = config.khanelinix.security.auditd; in { - options.${namespace}.security.auditd = { + options.khanelinix.security.auditd = { enable = lib.mkEnableOption "default auditd configuration"; }; diff --git a/modules/nixos/security/clamav/default.nix b/modules/nixos/security/clamav/default.nix index a1483c00d..5da69d5de 100644 --- a/modules/nixos/security/clamav/default.nix +++ b/modules/nixos/security/clamav/default.nix @@ -1,14 +1,14 @@ { config, lib, - namespace, + ... }: let - cfg = config.${namespace}.security.clamav; + cfg = config.khanelinix.security.clamav; in { - options.${namespace}.security.clamav = { + options.khanelinix.security.clamav = { enable = lib.mkEnableOption "default clamav configuration"; }; diff --git a/modules/nixos/security/default.nix b/modules/nixos/security/default.nix new file mode 100644 index 000000000..5d0aaa0a2 --- /dev/null +++ b/modules/nixos/security/default.nix @@ -0,0 +1,16 @@ +{ + imports = [ + ./acme + ./auditd + ./clamav + ./doas + ./gpg + ./keyring + ./pam + ./polkit + ./sops + ./sudo + ./sudo-rs + ./usbguard + ]; +} diff --git a/modules/nixos/security/doas/default.nix b/modules/nixos/security/doas/default.nix index 12fa8aa7f..8f0977728 100644 --- a/modules/nixos/security/doas/default.nix +++ b/modules/nixos/security/doas/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.security.doas; + cfg = config.khanelinix.security.doas; in { - options.${namespace}.security.doas = { + options.khanelinix.security.doas = { enable = mkBoolOpt false "Whether or not to replace sudo with doas."; }; @@ -31,7 +31,7 @@ in { keepEnv = true; noPass = true; - users = [ config.${namespace}.user.name ]; + users = [ config.khanelinix.user.name ]; } ]; }; diff --git a/modules/nixos/security/gpg/default.nix b/modules/nixos/security/gpg/default.nix index beb95f328..b5977af5b 100644 --- a/modules/nixos/security/gpg/default.nix +++ b/modules/nixos/security/gpg/default.nix @@ -2,7 +2,7 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let @@ -11,9 +11,9 @@ let mkIf getExe' ; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.security.gpg; + cfg = config.khanelinix.security.gpg; gpgAgentConf = '' enable-ssh-support @@ -23,7 +23,7 @@ let ''; in { - options.${namespace}.security.gpg = with types; { + options.khanelinix.security.gpg = with types; { enable = mkBoolOpt false "Whether or not to enable GPG."; agentTimeout = mkOpt int 5 "The amount of time to wait before continuing with shell init."; enableSSHSupport = mkBoolOpt false "Whether or not to enable SSH support for GPG."; diff --git a/modules/nixos/security/keyring/default.nix b/modules/nixos/security/keyring/default.nix index 43a8e3588..90b6b5270 100644 --- a/modules/nixos/security/keyring/default.nix +++ b/modules/nixos/security/keyring/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.security.keyring; + cfg = config.khanelinix.security.keyring; in { - options.${namespace}.security.keyring = { + options.khanelinix.security.keyring = { enable = mkBoolOpt false "Whether to enable gnome keyring."; }; diff --git a/modules/nixos/security/pam/default.nix b/modules/nixos/security/pam/default.nix index 7c94ce5e2..15abfa00f 100644 --- a/modules/nixos/security/pam/default.nix +++ b/modules/nixos/security/pam/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.security.pam; + cfg = config.khanelinix.security.pam; in { - options.${namespace}.security.pam = { + options.khanelinix.security.pam = { enable = mkBoolOpt false "Whether or not to configure pam."; }; diff --git a/modules/nixos/security/polkit/default.nix b/modules/nixos/security/polkit/default.nix index 0f534eb9d..7f0e50287 100644 --- a/modules/nixos/security/polkit/default.nix +++ b/modules/nixos/security/polkit/default.nix @@ -2,16 +2,16 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.security.polkit; + cfg = config.khanelinix.security.polkit; in { - options.${namespace}.security.polkit = { + options.khanelinix.security.polkit = { enable = mkBoolOpt false "Whether or not to enable polkit."; }; diff --git a/modules/nixos/security/sops/default.nix b/modules/nixos/security/sops/default.nix index 5d35cf7b9..e77f4f274 100644 --- a/modules/nixos/security/sops/default.nix +++ b/modules/nixos/security/sops/default.nix @@ -1,35 +1,39 @@ { config, + inputs, lib, - namespace, + root, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.security.sops; + cfg = config.khanelinix.security.sops; in { - options.${namespace}.security.sops = with lib.types; { + imports = lib.optional (inputs.sops-nix ? nixosModules) inputs.sops-nix.nixosModules.sops; + + options.khanelinix.security.sops = with lib.types; { enable = mkBoolOpt false "Whether to enable sops."; defaultSopsFile = mkOpt path null "Default sops file."; sshKeyPaths = mkOpt (listOf path) [ "/etc/ssh/ssh_host_ed25519_key" ] "SSH Key paths to use."; }; - config = lib.mkIf cfg.enable { + config = lib.mkIf (cfg.enable && (inputs.sops-nix ? nixosModules)) { sops = { inherit (cfg) defaultSopsFile; age = { inherit (cfg) sshKeyPaths; - keyFile = "${config.users.users.${config.${namespace}.user.name}.home}/.config/sops/age/keys.txt"; + keyFile = "${config.users.users.${config.khanelinix.user.name}.home}/.config/sops/age/keys.txt"; }; }; sops.secrets = { "khanelinix_khaneliman_ssh_key" = { - sopsFile = lib.snowfall.fs.get-file "secrets/khanelinix/khaneliman/default.yaml"; + sopsFile = root + "/secrets/khanelinix/khaneliman/default.yaml"; }; }; }; diff --git a/modules/nixos/security/sudo-rs/default.nix b/modules/nixos/security/sudo-rs/default.nix index dd09f22d4..d0ef149b2 100644 --- a/modules/nixos/security/sudo-rs/default.nix +++ b/modules/nixos/security/sudo-rs/default.nix @@ -2,16 +2,16 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.security.sudo-rs; + cfg = config.khanelinix.security.sudo-rs; in { - options.${namespace}.security.sudo-rs = { + options.khanelinix.security.sudo-rs = { enable = mkBoolOpt false "Whether or not to replace sudo with sudo-rs."; }; @@ -25,7 +25,7 @@ in # extraRules = [ # { # noPass = true; - # users = [ config.${namespace}.user.name ]; + # users = [ config.khanelinix.user.name ]; # } # ]; }; diff --git a/modules/nixos/security/sudo/default.nix b/modules/nixos/security/sudo/default.nix index 19d213ecd..274520d84 100644 --- a/modules/nixos/security/sudo/default.nix +++ b/modules/nixos/security/sudo/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, pkgs, ... }: let - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.security.sudo; + cfg = config.khanelinix.security.sudo; in { - options.${namespace}.security.sudo = { + options.khanelinix.security.sudo = { enable = mkBoolOpt false "Whether or not to enable sudo."; }; config = lib.mkIf cfg.enable { diff --git a/modules/nixos/security/usbguard/default.nix b/modules/nixos/security/usbguard/default.nix index c408112cb..5b20f7fc0 100644 --- a/modules/nixos/security/usbguard/default.nix +++ b/modules/nixos/security/usbguard/default.nix @@ -1,14 +1,14 @@ { config, lib, - namespace, + ... }: let - cfg = config.${namespace}.security.usbguard; + cfg = config.khanelinix.security.usbguard; in { - options.${namespace}.security.usbguard = { + options.khanelinix.security.usbguard = { enable = lib.mkEnableOption "default usbguard configuration"; }; diff --git a/modules/nixos/services/avahi/default.nix b/modules/nixos/services/avahi/default.nix index 241939813..d7848eb8c 100644 --- a/modules/nixos/services/avahi/default.nix +++ b/modules/nixos/services/avahi/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + ... }: let - cfg = config.${namespace}.services.avahi; + cfg = config.khanelinix.services.avahi; inherit (lib) mkEnableOption mkIf; in { - options.${namespace}.services.avahi = { + options.khanelinix.services.avahi = { enable = mkEnableOption "Avahi"; }; diff --git a/modules/nixos/services/cloudflared/default.nix b/modules/nixos/services/cloudflared/default.nix index 74d1e053b..13a6103b8 100644 --- a/modules/nixos/services/cloudflared/default.nix +++ b/modules/nixos/services/cloudflared/default.nix @@ -2,17 +2,17 @@ lib, pkgs, config, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.cloudflared; + cfg = config.khanelinix.services.cloudflared; in { - options.${namespace}.services.cloudflared = { + options.khanelinix.services.cloudflared = { enable = mkBoolOpt false "Whether or not to configure cloudflared"; }; @@ -21,7 +21,7 @@ in # assertions = [ # { # assertion = cfg.autoconnect.enable -> cfg.autoconnect.key != ""; - # message = "${namespace}.services.cloudflared.autoconnect.key must be set"; + # message = "khanelinix.services.cloudflared.autoconnect.key must be set"; # } # ]; diff --git a/modules/nixos/services/dbus/default.nix b/modules/nixos/services/dbus/default.nix index bc0236c50..74c504b2b 100644 --- a/modules/nixos/services/dbus/default.nix +++ b/modules/nixos/services/dbus/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.dbus; + cfg = config.khanelinix.services.dbus; in { - options.${namespace}.services.dbus = { + options.khanelinix.services.dbus = { enable = mkBoolOpt true "Whether or not to enable dbus service."; }; diff --git a/modules/nixos/services/ddc/default.nix b/modules/nixos/services/ddc/default.nix index 4627c0d0c..f152a2a39 100644 --- a/modules/nixos/services/ddc/default.nix +++ b/modules/nixos/services/ddc/default.nix @@ -2,17 +2,17 @@ lib, pkgs, config, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.ddccontrol; + cfg = config.khanelinix.services.ddccontrol; in { - options.${namespace}.services.ddccontrol = { + options.khanelinix.services.ddccontrol = { enable = mkBoolOpt false "Whether or not to configure ddccontrol"; }; diff --git a/modules/nixos/services/default.nix b/modules/nixos/services/default.nix new file mode 100644 index 000000000..964b8a4d1 --- /dev/null +++ b/modules/nixos/services/default.nix @@ -0,0 +1,25 @@ +{ + imports = [ + ./avahi + ./cloudflared + ./dbus + ./ddc + ./earlyoom + ./flatpak + ./geoclue + ./logind + ./logrotate + ./oomd + ./openssh + ./power + ./printing + ./rustdesk-server + ./samba + ./seatd + ./snapper + ./spice-vdagentd + ./spice-webdav + ./tailscale + ./udisks2 + ]; +} diff --git a/modules/nixos/services/earlyoom/default.nix b/modules/nixos/services/earlyoom/default.nix index 9c321ca3a..f245dcd32 100644 --- a/modules/nixos/services/earlyoom/default.nix +++ b/modules/nixos/services/earlyoom/default.nix @@ -1,18 +1,18 @@ { config, lib, - namespace, + khanelinix-lib, pkgs, ... }: let inherit (lib) concatStringsSep mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.earlyoom; + cfg = config.khanelinix.services.earlyoom; in { - options.${namespace}.services.earlyoom = { + options.khanelinix.services.earlyoom = { enable = mkBoolOpt false "Whether or not to configure oomd."; }; diff --git a/modules/nixos/services/flatpak/default.nix b/modules/nixos/services/flatpak/default.nix index 5747203ea..7cfec362f 100644 --- a/modules/nixos/services/flatpak/default.nix +++ b/modules/nixos/services/flatpak/default.nix @@ -1,17 +1,20 @@ { config, + inputs, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.flatpak; + cfg = config.khanelinix.services.flatpak; in { - options.${namespace}.services.flatpak = { + imports = lib.optional (inputs.nix-flatpak ? flakeModule) inputs.nix-flatpak.flakeModule; + + options.khanelinix.services.flatpak = { enable = mkBoolOpt false "Whether or not to enable flatpak support."; extraRepos = lib.mkOption { default = [ @@ -40,7 +43,7 @@ in }; }; - config = mkIf cfg.enable { + config = mkIf (cfg.enable && (inputs.nix-flatpak ? flakeModule)) { services.flatpak = { enable = true; diff --git a/modules/nixos/services/geoclue/default.nix b/modules/nixos/services/geoclue/default.nix index 01f3c272d..122fd06d9 100644 --- a/modules/nixos/services/geoclue/default.nix +++ b/modules/nixos/services/geoclue/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.geoclue; + cfg = config.khanelinix.services.geoclue; in { - options.${namespace}.services.geoclue = { + options.khanelinix.services.geoclue = { enable = mkBoolOpt false "Whether or not to configure geoclue support."; }; diff --git a/modules/nixos/services/logind/default.nix b/modules/nixos/services/logind/default.nix index b96063563..fba835bc5 100644 --- a/modules/nixos/services/logind/default.nix +++ b/modules/nixos/services/logind/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + ... }: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.services.logind; + cfg = config.khanelinix.services.logind; in { - options.${namespace}.services.logind = { + options.khanelinix.services.logind = { enable = mkEnableOption "logind"; }; diff --git a/modules/nixos/services/logrotate/default.nix b/modules/nixos/services/logrotate/default.nix index 3497ea0da..f0886cbaf 100644 --- a/modules/nixos/services/logrotate/default.nix +++ b/modules/nixos/services/logrotate/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.logrotate; + cfg = config.khanelinix.services.logrotate; in { - options.${namespace}.services.logrotate = { + options.khanelinix.services.logrotate = { enable = mkBoolOpt false "Whether or not to configure logrotate."; }; diff --git a/modules/nixos/services/oomd/default.nix b/modules/nixos/services/oomd/default.nix index 023dbd8f2..39f2a58a1 100644 --- a/modules/nixos/services/oomd/default.nix +++ b/modules/nixos/services/oomd/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.oomd; + cfg = config.khanelinix.services.oomd; in { - options.${namespace}.services.oomd = { + options.khanelinix.services.oomd = { enable = mkBoolOpt false "Whether or not to configure oomd."; }; diff --git a/modules/nixos/services/openssh/default.nix b/modules/nixos/services/openssh/default.nix index c27fa0c2b..c50352993 100644 --- a/modules/nixos/services/openssh/default.nix +++ b/modules/nixos/services/openssh/default.nix @@ -2,7 +2,7 @@ config, format, lib, - namespace, + khanelinix-lib, ... }: let @@ -11,12 +11,12 @@ let mkDefault mkIf ; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.services.openssh; + cfg = config.khanelinix.services.openssh; in { - options.${namespace}.services.openssh = with types; { + options.khanelinix.services.openssh = with types; { enable = mkBoolOpt false "Whether or not to configure OpenSSH support."; authorizedKeys = mkOpt (listOf str) [ default-key ] "The public keys to apply."; extraConfig = mkOpt str "" "Extra configuration to apply."; diff --git a/modules/nixos/services/power/default.nix b/modules/nixos/services/power/default.nix index b8efe81bb..867af4588 100644 --- a/modules/nixos/services/power/default.nix +++ b/modules/nixos/services/power/default.nix @@ -1,17 +1,17 @@ { lib, config, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.power; + cfg = config.khanelinix.services.power; in { - options.${namespace}.services.power = { + options.khanelinix.services.power = { enable = mkBoolOpt false "Whether or not to configure power profiles"; }; diff --git a/modules/nixos/services/printing/default.nix b/modules/nixos/services/printing/default.nix index 526ca2dfd..0d546c778 100644 --- a/modules/nixos/services/printing/default.nix +++ b/modules/nixos/services/printing/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.printing; + cfg = config.khanelinix.services.printing; in { - options.${namespace}.services.printing = { + options.khanelinix.services.printing = { enable = mkBoolOpt false "Whether or not to configure printing support."; }; diff --git a/modules/nixos/services/rustdesk-server/default.nix b/modules/nixos/services/rustdesk-server/default.nix index 6a7797b38..c3785ff8d 100644 --- a/modules/nixos/services/rustdesk-server/default.nix +++ b/modules/nixos/services/rustdesk-server/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkEnableOption mkIf; - inherit (lib.${namespace}) mkOpt; + inherit (khanelinix-lib) mkOpt; - cfg = config.${namespace}.services.rustdesk-server; + cfg = config.khanelinix.services.rustdesk-server; in { - options.${namespace}.services.rustdesk-server = { + options.khanelinix.services.rustdesk-server = { enable = mkEnableOption "rustdesk-server"; relayHosts = mkOpt (lib.types.listOf lib.types.str) [ ] "Groups for the user to be assigned."; }; diff --git a/modules/nixos/services/samba/default.nix b/modules/nixos/services/samba/default.nix index af55b206c..552ca584f 100644 --- a/modules/nixos/services/samba/default.nix +++ b/modules/nixos/services/samba/default.nix @@ -1,7 +1,7 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let @@ -12,9 +12,9 @@ let optionalAttrs types ; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.services.samba; + cfg = config.khanelinix.services.samba; bool-to-yes-no = value: if value then "yes" else "no"; @@ -29,7 +29,7 @@ let browseable = mkBoolOpt true "Whether the share is browseable."; comment = mkOpt str name "An optional comment."; read-only = mkBoolOpt false "Whether the share should be read only."; - only-owner-editable = mkBoolOpt false "Whether the share is only writable by the system owner (${namespace}.user.name)."; + only-owner-editable = mkBoolOpt false "Whether the share is only writable by the system owner (khanelinix.user.name)."; extra-config = mkOpt attrs { } "Extra configuration options for the share."; }; @@ -37,7 +37,7 @@ let ); in { - options.${namespace}.services.samba = with types; { + options.khanelinix.services.samba = with types; { enable = mkEnableOption "Samba"; browseable = mkBoolOpt true "Whether the shares are browseable."; workgroup = mkOpt str "WORKGROUP" "The workgroup to use."; @@ -76,7 +76,7 @@ in "read only" = bool-to-yes-no value.read-only; } // (optionalAttrs value.only-owner-editable { - "write list" = config.${namespace}.user.name; + "write list" = config.khanelinix.user.name; "read list" = "guest, nobody"; "create mask" = "0755"; "directory mask" = "0755"; @@ -90,7 +90,7 @@ in # sambaUserSetup = { # text = '' # PATH=$PATH:${lib.makeBinPath [ pkgs.samba ]} - # pdbedit -i smbpasswd:/home/${config.${namespace}.user.name}/smbpasswd -e tdbsam:/var/lib/samba/private/passdb.tdb + # pdbedit -i smbpasswd:/home/${config.khanelinix.user.name}/smbpasswd -e tdbsam:/var/lib/samba/private/passdb.tdb # ''; # deps = [ ]; # }; diff --git a/modules/nixos/services/seatd/default.nix b/modules/nixos/services/seatd/default.nix index 249a8f6d4..ca5460867 100644 --- a/modules/nixos/services/seatd/default.nix +++ b/modules/nixos/services/seatd/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + ... }: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.services.seatd; + cfg = config.khanelinix.services.seatd; in { - options.${namespace}.services.seatd = { + options.khanelinix.services.seatd = { enable = mkEnableOption "seatd"; }; diff --git a/modules/nixos/services/snapper/default.nix b/modules/nixos/services/snapper/default.nix index f02aca6c6..eaad866ac 100644 --- a/modules/nixos/services/snapper/default.nix +++ b/modules/nixos/services/snapper/default.nix @@ -1,11 +1,11 @@ { config, lib, - namespace, + ... }: let - cfg = config.${namespace}.services.snapper; + cfg = config.khanelinix.services.snapper; safeStr = types.strMatching "[^\n\"]*" // { description = "string without line breaks or quotes"; @@ -15,7 +15,7 @@ let inherit (lib) types mkEnableOption mkIf; in { - options.${namespace}.services.snapper = { + options.khanelinix.services.snapper = { enable = mkEnableOption "snapper"; configs = lib.mkOption { diff --git a/modules/nixos/services/spice-vdagentd/default.nix b/modules/nixos/services/spice-vdagentd/default.nix index 7574cf262..9c726c7dd 100644 --- a/modules/nixos/services/spice-vdagentd/default.nix +++ b/modules/nixos/services/spice-vdagentd/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf getExe'; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.spice-vdagentd; + cfg = config.khanelinix.services.spice-vdagentd; in { - options.${namespace}.services.spice-vdagentd = { + options.khanelinix.services.spice-vdagentd = { enable = mkBoolOpt false "Whether or not to configure spice-vdagent support."; }; diff --git a/modules/nixos/services/spice-webdav/default.nix b/modules/nixos/services/spice-webdav/default.nix index 92a994bc2..6a99eb4aa 100644 --- a/modules/nixos/services/spice-webdav/default.nix +++ b/modules/nixos/services/spice-webdav/default.nix @@ -2,7 +2,7 @@ config, pkgs, lib, - namespace, + khanelinix-lib, ... }: let @@ -12,12 +12,12 @@ let mkOption getExe' ; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.spice-webdav; + cfg = config.khanelinix.services.spice-webdav; in { - options.${namespace}.services.spice-webdav = with types; { + options.khanelinix.services.spice-webdav = with types; { enable = mkBoolOpt false "Whether or not to configure spice-webdav proxy support."; package = mkOption { default = pkgs.phodav; diff --git a/modules/nixos/services/tailscale/default.nix b/modules/nixos/services/tailscale/default.nix index 3e373b779..4f982b79e 100644 --- a/modules/nixos/services/tailscale/default.nix +++ b/modules/nixos/services/tailscale/default.nix @@ -2,18 +2,18 @@ lib, pkgs, config, - namespace, + khanelinix-lib, ... }: let inherit (lib) types mkIf; inherit (lib.modules) mkBefore; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.services.tailscale; + cfg = config.khanelinix.services.tailscale; in { - options.${namespace}.services.tailscale = with types; { + options.khanelinix.services.tailscale = with types; { enable = mkBoolOpt false "Whether or not to configure Tailscale"; autoconnect = { enable = mkBoolOpt false "Whether or not to enable automatic connection to Tailscale"; @@ -25,7 +25,7 @@ in assertions = [ { assertion = cfg.autoconnect.enable -> cfg.autoconnect.key != ""; - message = "${namespace}.services.tailscale.autoconnect.key must be set"; + message = "khanelinix.services.tailscale.autoconnect.key must be set"; } ]; diff --git a/modules/nixos/services/udisks2/default.nix b/modules/nixos/services/udisks2/default.nix index 8703aa38a..55121aa9e 100644 --- a/modules/nixos/services/udisks2/default.nix +++ b/modules/nixos/services/udisks2/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.services.udisks2; + cfg = config.khanelinix.services.udisks2; in { - options.${namespace}.services.udisks2 = { + options.khanelinix.services.udisks2 = { enable = mkBoolOpt true "Whether or not to enable udisks2 service."; }; diff --git a/modules/nixos/suites/common/default.nix b/modules/nixos/suites/common/default.nix index 1e7218335..740447fd5 100644 --- a/modules/nixos/suites/common/default.nix +++ b/modules/nixos/suites/common/default.nix @@ -2,17 +2,18 @@ config, lib, pkgs, - namespace, + root, + khanelinix-lib, ... }: let inherit (lib) mkIf mkDefault; - inherit (lib.${namespace}) enabled; + inherit (khanelinix-lib) enabled; - cfg = config.${namespace}.suites.common; + cfg = config.khanelinix.suites.common; in { - imports = [ (lib.snowfall.fs.get-file "modules/shared/suites/common/default.nix") ]; + imports = [ (root + "/modules/shared/suites/common/default.nix") ]; config = mkIf cfg.enable { @@ -24,8 +25,8 @@ in dnsutils lshw pciutils - pkgs.${namespace}.trace-symlink - pkgs.${namespace}.trace-which + self.packages.${system}.trace-symlink + self.packages.${system}.trace-which rsync util-linux wget diff --git a/modules/nixos/suites/default.nix b/modules/nixos/suites/default.nix new file mode 100644 index 000000000..a8070cecd --- /dev/null +++ b/modules/nixos/suites/default.nix @@ -0,0 +1,11 @@ +{ + imports = [ + ./common + ./desktop + ./development + ./games + ./video + ./vm + ./wlroots + ]; +} diff --git a/modules/nixos/suites/desktop/default.nix b/modules/nixos/suites/desktop/default.nix index 2915bb640..c10b95cfc 100644 --- a/modules/nixos/suites/desktop/default.nix +++ b/modules/nixos/suites/desktop/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.suites.desktop; + cfg = config.khanelinix.suites.desktop; in { - options.${namespace}.suites.desktop = { + options.khanelinix.suites.desktop = { enable = mkBoolOpt false "Whether or not to enable common desktop configuration."; }; diff --git a/modules/nixos/suites/development/default.nix b/modules/nixos/suites/development/default.nix index 4a78ada46..1a2c82b6a 100644 --- a/modules/nixos/suites/development/default.nix +++ b/modules/nixos/suites/development/default.nix @@ -1,16 +1,16 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.development; + cfg = config.khanelinix.suites.development; in { - options.${namespace}.suites.development = { + options.khanelinix.suites.development = { enable = mkBoolOpt false "Whether or not to enable common development configuration."; azureEnable = mkBoolOpt false "Whether or not to enable azure development configuration."; dockerEnable = mkBoolOpt false "Whether or not to enable docker development configuration."; diff --git a/modules/nixos/suites/games/default.nix b/modules/nixos/suites/games/default.nix index 117a2fb38..a8b5c6a0a 100644 --- a/modules/nixos/suites/games/default.nix +++ b/modules/nixos/suites/games/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkDefault; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.suites.games; + cfg = config.khanelinix.suites.games; in { - options.${namespace}.suites.games = { + options.khanelinix.suites.games = { enable = mkBoolOpt false "Whether or not to enable common games configuration."; }; diff --git a/modules/nixos/suites/video/default.nix b/modules/nixos/suites/video/default.nix index 77731ef47..cd8289bdf 100644 --- a/modules/nixos/suites/video/default.nix +++ b/modules/nixos/suites/video/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, pkgs, ... }: let - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.video; + cfg = config.khanelinix.suites.video; in { - options.${namespace}.suites.video = { + options.khanelinix.suites.video = { enable = mkBoolOpt false "Whether or not to enable video configuration."; }; diff --git a/modules/nixos/suites/vm/default.nix b/modules/nixos/suites/vm/default.nix index c1df39684..0e0363ee1 100644 --- a/modules/nixos/suites/vm/default.nix +++ b/modules/nixos/suites/vm/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.suites.vm; + cfg = config.khanelinix.suites.vm; in { - options.${namespace}.suites.vm = { + options.khanelinix.suites.vm = { enable = mkBoolOpt false "Whether or not to enable common vm configuration."; }; diff --git a/modules/nixos/suites/wlroots/default.nix b/modules/nixos/suites/wlroots/default.nix index e592b4980..5901bf7e9 100644 --- a/modules/nixos/suites/wlroots/default.nix +++ b/modules/nixos/suites/wlroots/default.nix @@ -1,18 +1,18 @@ { config, lib, - namespace, + khanelinix-lib, pkgs, ... }: let inherit (lib) mkIf mkDefault; - inherit (lib.${namespace}) mkBoolOpt enabled; + inherit (khanelinix-lib) mkBoolOpt enabled; - cfg = config.${namespace}.suites.wlroots; + cfg = config.khanelinix.suites.wlroots; in { - options.${namespace}.suites.wlroots = { + options.khanelinix.suites.wlroots = { enable = mkBoolOpt false "Whether or not to enable common wlroots configuration."; }; diff --git a/modules/nixos/system/boot/default.nix b/modules/nixos/system/boot/default.nix index 16059c3ec..d9a531e5e 100644 --- a/modules/nixos/system/boot/default.nix +++ b/modules/nixos/system/boot/default.nix @@ -1,19 +1,22 @@ { config, + inputs, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt default-attrs; + inherit (khanelinix-lib) mkBoolOpt default-attrs; - cfg = config.${namespace}.system.boot; - themeCfg = config.${namespace}.theme; + cfg = config.khanelinix.system.boot; + themeCfg = config.khanelinix.theme; in { - options.${namespace}.system.boot = { + imports = lib.optional (inputs.lanzaboote ? nixosModules) inputs.lanzaboote.nixosModules.lanzaboote; + + options.khanelinix.system.boot = { enable = mkBoolOpt false "Whether or not to enable booting."; plymouth = mkBoolOpt false "Whether or not to enable plymouth boot splash."; secureBoot = mkBoolOpt false "Whether or not to enable secure boot."; @@ -30,63 +33,65 @@ in ] ++ lib.optionals cfg.secureBoot [ sbctl ]; - boot = { - kernelParams = - lib.optionals cfg.plymouth [ "quiet" ] - ++ lib.optionals cfg.silentBoot [ - # tell the kernel to not be verbose - "quiet" + boot = + { + kernelParams = + lib.optionals cfg.plymouth [ "quiet" ] + ++ lib.optionals cfg.silentBoot [ + # tell the kernel to not be verbose + "quiet" - # kernel log message level - "loglevel=3" # 1: system is unusable | 3: error condition | 7: very verbose + # kernel log message level + "loglevel=3" # 1: system is unusable | 3: error condition | 7: very verbose - # udev log message level - "udev.log_level=3" + # udev log message level + "udev.log_level=3" - # lower the udev log level to show only errors or worse - "rd.udev.log_level=3" + # lower the udev log level to show only errors or worse + "rd.udev.log_level=3" - # disable systemd status messages - # rd prefix means systemd-udev will be used instead of initrd - "systemd.show_status=auto" - "rd.systemd.show_status=auto" + # disable systemd status messages + # rd prefix means systemd-udev will be used instead of initrd + "systemd.show_status=auto" + "rd.systemd.show_status=auto" - # disable the cursor in vt to get a black screen during intermissions - "vt.global_cursor_default=0" - ]; + # disable the cursor in vt to get a black screen during intermissions + "vt.global_cursor_default=0" + ]; - lanzaboote = mkIf cfg.secureBoot { - enable = true; - pkiBundle = "/etc/secureboot"; - }; + loader = { + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; + }; - loader = { - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot"; - }; + generationsDir.copyKernels = true; - generationsDir.copyKernels = true; - - systemd-boot = { - enable = !cfg.secureBoot; - configurationLimit = 20; - editor = false; + systemd-boot = { + enable = !cfg.secureBoot; + configurationLimit = 20; + editor = false; + }; }; - }; - plymouth = { - enable = cfg.plymouth; - theme = "${themeCfg.selectedTheme.name}-${themeCfg.selectedTheme.variant}"; - themePackages = [ pkgs.catppuccin-plymouth ]; - }; + plymouth = { + enable = cfg.plymouth; + theme = "${themeCfg.selectedTheme.name}-${themeCfg.selectedTheme.variant}"; + themePackages = [ pkgs.catppuccin-plymouth ]; + }; - tmp = default-attrs { - useTmpfs = true; - cleanOnBoot = true; - tmpfsSize = "50%"; + tmp = default-attrs { + useTmpfs = true; + cleanOnBoot = true; + tmpfsSize = "50%"; + }; + } + // lib.optionalAttrs (inputs.lanzaboote ? nixosModules) { + lanzaboote = mkIf cfg.secureBoot { + enable = true; + pkiBundle = "/etc/secureboot"; + }; }; - }; services.fwupd = { enable = true; diff --git a/modules/nixos/system/default.nix b/modules/nixos/system/default.nix new file mode 100644 index 000000000..00c29725c --- /dev/null +++ b/modules/nixos/system/default.nix @@ -0,0 +1,12 @@ +{ + imports = [ + ./boot + ./env + ./fonts + ./locale + ./networking + ./realtime + ./time + ./xkb + ]; +} diff --git a/modules/nixos/system/env/default.nix b/modules/nixos/system/env/default.nix index 65cb5161a..f8ce87711 100644 --- a/modules/nixos/system/env/default.nix +++ b/modules/nixos/system/env/default.nix @@ -1,7 +1,7 @@ { config, lib, - namespace, + ... }: let @@ -13,10 +13,10 @@ let " --wordwrap" # Wrap lines at spaces. ]; - cfg = config.${namespace}.system.env; + cfg = config.khanelinix.system.env; in { - options.${namespace}.system.env = lib.mkOption { + options.khanelinix.system.env = lib.mkOption { apply = lib.mapAttrs ( _n: v: if lib.isList v then lib.concatMapStringsSep ":" toString v else (toString v) ); diff --git a/modules/nixos/system/fonts/default.nix b/modules/nixos/system/fonts/default.nix index 94f891252..8ad14e868 100644 --- a/modules/nixos/system/fonts/default.nix +++ b/modules/nixos/system/fonts/default.nix @@ -2,16 +2,16 @@ config, lib, pkgs, - namespace, + root, ... }: let inherit (lib) mkIf mapAttrs; - cfg = config.${namespace}.system.fonts; + cfg = config.khanelinix.system.fonts; in { - imports = [ (lib.snowfall.fs.get-file "modules/shared/system/fonts/default.nix") ]; + imports = [ (root + "/modules/shared/system/fonts/default.nix") ]; config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ diff --git a/modules/nixos/system/locale/default.nix b/modules/nixos/system/locale/default.nix index 779638609..6ac90372c 100644 --- a/modules/nixos/system/locale/default.nix +++ b/modules/nixos/system/locale/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf mkForce; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.system.locale; + cfg = config.khanelinix.system.locale; in { - options.${namespace}.system.locale = { + options.khanelinix.system.locale = { enable = mkBoolOpt false "Whether or not to manage locale settings."; }; diff --git a/modules/nixos/system/networking/default.nix b/modules/nixos/system/networking/default.nix index 494ad2a72..b62d65e09 100644 --- a/modules/nixos/system/networking/default.nix +++ b/modules/nixos/system/networking/default.nix @@ -2,7 +2,7 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let @@ -12,12 +12,12 @@ let mkDefault mkForce ; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.system.networking; + cfg = config.khanelinix.system.networking; in { - options.${namespace}.system.networking = with types; { + options.khanelinix.system.networking = with types; { enable = mkBoolOpt false "Whether or not to enable networking support"; hosts = mkOpt attrs { } "An attribute set to merge with "; optimizeTcp = mkBoolOpt false "Optimize TCP connections"; diff --git a/modules/nixos/system/networking/dnsmasq/default.nix b/modules/nixos/system/networking/dnsmasq/default.nix index 39de2b206..c7a7b96a4 100644 --- a/modules/nixos/system/networking/dnsmasq/default.nix +++ b/modules/nixos/system/networking/dnsmasq/default.nix @@ -1,13 +1,13 @@ { config, lib, - namespace, + ... }: let inherit (lib) mkIf mkForce; - cfg = config.${namespace}.system.networking; + cfg = config.khanelinix.system.networking; in { config = mkIf (cfg.enable && cfg.dns == "dnsmasq") { diff --git a/modules/nixos/system/networking/networkd/default.nix b/modules/nixos/system/networking/networkd/default.nix index eaa1dbc68..5860014ab 100644 --- a/modules/nixos/system/networking/networkd/default.nix +++ b/modules/nixos/system/networking/networkd/default.nix @@ -1,13 +1,13 @@ { config, lib, - namespace, + ... }: let inherit (lib) mkIf mkForce; - cfg = config.${namespace}.system.networking; + cfg = config.khanelinix.system.networking; in { config = mkIf cfg.enable { @@ -34,7 +34,7 @@ in }; # let me configure tailscale manually - "20-tailscale-ignore" = mkIf config.${namespace}.services.tailscale.enable { + "20-tailscale-ignore" = mkIf config.khanelinix.services.tailscale.enable { matchConfig.Name = "tailscale*"; linkConfig = { Unmanaged = "yes"; diff --git a/modules/nixos/system/networking/networkmanager/default.nix b/modules/nixos/system/networking/networkmanager/default.nix index d525e65a9..44ea9146a 100644 --- a/modules/nixos/system/networking/networkmanager/default.nix +++ b/modules/nixos/system/networking/networkmanager/default.nix @@ -2,13 +2,13 @@ config, lib, pkgs, - namespace, + ... }: let inherit (lib) mkIf; - cfg = config.${namespace}.system.networking; + cfg = config.khanelinix.system.networking; in { config = mkIf cfg.enable { @@ -33,9 +33,9 @@ in "interface-name:br-*" "interface-name:rndis*" ] - ++ lib.optionals config.${namespace}.services.tailscale.enable [ "interface-name:tailscale*" ] - ++ lib.optionals config.${namespace}.virtualisation.podman.enable [ "interface-name:docker*" ] - ++ lib.optionals config.${namespace}.virtualisation.kvm.enable [ "interface-name:virbr*" ]; + ++ lib.optionals config.khanelinix.services.tailscale.enable [ "interface-name:tailscale*" ] + ++ lib.optionals config.khanelinix.virtualisation.podman.enable [ "interface-name:docker*" ] + ++ lib.optionals config.khanelinix.virtualisation.kvm.enable [ "interface-name:virbr*" ]; }; systemd.services.NetworkManager-wait-online.enable = lib.mkForce false; diff --git a/modules/nixos/system/networking/resolved/default.nix b/modules/nixos/system/networking/resolved/default.nix index 40605b68c..0d34fa38f 100644 --- a/modules/nixos/system/networking/resolved/default.nix +++ b/modules/nixos/system/networking/resolved/default.nix @@ -1,13 +1,13 @@ { config, lib, - namespace, + ... }: let inherit (lib) mkIf mkForce; - cfg = config.${namespace}.system.networking; + cfg = config.khanelinix.system.networking; in { config = mkIf (cfg.enable && cfg.dns == "systemd-resolved") { diff --git a/modules/nixos/system/realtime/default.nix b/modules/nixos/system/realtime/default.nix index db04edcc3..b79d28f10 100644 --- a/modules/nixos/system/realtime/default.nix +++ b/modules/nixos/system/realtime/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.system.realtime; + cfg = config.khanelinix.system.realtime; in { - options.${namespace}.system.realtime = { + options.khanelinix.system.realtime = { enable = mkBoolOpt false "Whether or not to configure realtime."; }; @@ -21,7 +21,7 @@ in # tldr: realtime processes have higher priority than normal processes # and that's a good thing users = { - users."${config.${namespace}.user.name}".extraGroups = [ "realtime" ]; + users."${config.khanelinix.user.name}".extraGroups = [ "realtime" ]; groups.realtime = { }; }; diff --git a/modules/nixos/system/time/default.nix b/modules/nixos/system/time/default.nix index 983053672..0b276dd92 100644 --- a/modules/nixos/system/time/default.nix +++ b/modules/nixos/system/time/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.system.time; + cfg = config.khanelinix.system.time; in { - options.${namespace}.system.time = { + options.khanelinix.system.time = { enable = mkBoolOpt false "Whether or not to configure time related settings."; }; diff --git a/modules/nixos/system/xkb/default.nix b/modules/nixos/system/xkb/default.nix index e30adcb7a..8ae00bd7e 100644 --- a/modules/nixos/system/xkb/default.nix +++ b/modules/nixos/system/xkb/default.nix @@ -1,17 +1,17 @@ { config, lib, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.system.xkb; + cfg = config.khanelinix.system.xkb; in { - options.${namespace}.system.xkb = { + options.khanelinix.system.xkb = { enable = mkBoolOpt false "Whether or not to configure xkb."; }; diff --git a/modules/nixos/theme/default.nix b/modules/nixos/theme/default.nix index fa124d5ec..d25a48035 100644 --- a/modules/nixos/theme/default.nix +++ b/modules/nixos/theme/default.nix @@ -1,8 +1,8 @@ { config, + khanelinix-lib, lib, pkgs, - namespace, ... }: let @@ -12,9 +12,9 @@ let mkOption types ; - inherit (lib.${namespace}) mkOpt; + inherit (khanelinix-lib) mkOpt; - cfg = config.${namespace}.theme; + cfg = config.khanelinix.theme; catppuccinAccents = [ "rosewater" @@ -40,8 +40,13 @@ let ]; in { + imports = [ + ./gtk + ./qt + ]; + # TODO: consolidate home-manager and nixos module - options.${namespace}.theme = { + options.khanelinix.theme = { enable = mkEnableOption "Enable custom theme use for applications."; cursor = { diff --git a/modules/nixos/theme/gtk/default.nix b/modules/nixos/theme/gtk/default.nix index 6f418873b..2f39e189c 100644 --- a/modules/nixos/theme/gtk/default.nix +++ b/modules/nixos/theme/gtk/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) types mkIf; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.theme.gtk; + cfg = config.khanelinix.theme.gtk; in { - options.${namespace}.theme.gtk = with types; { + options.khanelinix.theme.gtk = with types; { enable = mkBoolOpt false "Whether to customize GTK and apply themes."; theme = { diff --git a/modules/nixos/theme/qt/default.nix b/modules/nixos/theme/qt/default.nix index de543a558..c4705d8b1 100644 --- a/modules/nixos/theme/qt/default.nix +++ b/modules/nixos/theme/qt/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) types mkIf; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.theme.qt; + cfg = config.khanelinix.theme.qt; in { - options.${namespace}.theme.qt = with types; { + options.khanelinix.theme.qt = with types; { enable = mkBoolOpt false "Whether to customize qt and apply themes."; theme = { @@ -28,8 +28,7 @@ in environment = { systemPackages = with pkgs; - [ cfg.theme.package ] - ++ lib.optional config.${namespace}.suites.wlroots.enable kdePackages.qtwayland; + [ cfg.theme.package ] ++ lib.optional config.khanelinix.suites.wlroots.enable kdePackages.qtwayland; }; qt = { diff --git a/modules/nixos/user/default.nix b/modules/nixos/user/default.nix index 6b1361f83..5a50b72bc 100644 --- a/modules/nixos/user/default.nix +++ b/modules/nixos/user/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) types; - inherit (lib.${namespace}) mkOpt; + inherit (khanelinix-lib) mkOpt; - cfg = config.${namespace}.user; + cfg = config.khanelinix.user; in { - options.${namespace}.user = with types; { + options.khanelinix.user = with types; { email = mkOpt str "khaneliman12@gmail.com" "The email of the user."; extraGroups = mkOpt (listOf str) [ ] "Groups for the user to be assigned."; extraOptions = mkOpt attrs { } "Extra options passed to ."; diff --git a/modules/nixos/virtualisation/default.nix b/modules/nixos/virtualisation/default.nix new file mode 100644 index 000000000..bf5893d3a --- /dev/null +++ b/modules/nixos/virtualisation/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./kvm + ./podman + ]; +} diff --git a/modules/nixos/virtualisation/kvm/default.nix b/modules/nixos/virtualisation/kvm/default.nix index 7938f8a84..c8f88dd77 100644 --- a/modules/nixos/virtualisation/kvm/default.nix +++ b/modules/nixos/virtualisation/kvm/default.nix @@ -2,7 +2,7 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let @@ -14,13 +14,13 @@ let concatStringsSep getExe ; - inherit (lib.${namespace}) mkBoolOpt mkOpt enabled; - inherit (config.${namespace}) user; + inherit (khanelinix-lib) mkBoolOpt mkOpt enabled; + inherit (config.khanelinix) user; - cfg = config.${namespace}.virtualisation.kvm; + cfg = config.khanelinix.virtualisation.kvm; in { - options.${namespace}.virtualisation.kvm = with types; { + options.khanelinix.virtualisation.kvm = with types; { enable = mkBoolOpt false "Whether or not to enable KVM virtualisation."; # Use `machinectl` and then `machinectl status ` to # get the unit "*.scope" of the virtual machine. diff --git a/modules/nixos/virtualisation/podman/default.nix b/modules/nixos/virtualisation/podman/default.nix index d7f9e2e42..6f1c34c25 100644 --- a/modules/nixos/virtualisation/podman/default.nix +++ b/modules/nixos/virtualisation/podman/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.virtualisation.podman; + cfg = config.khanelinix.virtualisation.podman; in { - options.${namespace}.virtualisation.podman = { + options.khanelinix.virtualisation.podman = { enable = mkBoolOpt false "Whether or not to enable Podman."; }; diff --git a/modules/shared/nix/default.nix b/modules/shared/nix/default.nix index 4e7afd73f..93f26fc22 100644 --- a/modules/shared/nix/default.nix +++ b/modules/shared/nix/default.nix @@ -3,17 +3,17 @@ inputs, lib, pkgs, - namespace, + khanelinix-lib, host, ... }: let - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.nix; + cfg = config.khanelinix.nix; in { - options.${namespace}.nix = { + options.khanelinix.nix = { enable = mkBoolOpt true "Whether or not to manage nix configuration."; package = mkOpt lib.types.package pkgs.nixVersions.latest "Which nix package to use."; }; @@ -67,7 +67,7 @@ in "root" "@wheel" "nix-builder" - config.${namespace}.user.name + config.khanelinix.user.name ]; in { @@ -82,8 +82,7 @@ in "nixos-test" ]; in - # Linux builders - lib.optionals config.${namespace}.security.sops.enable [ + lib.optionals config.khanelinix.security.sops.enable [ ( lib.mkIf (host != "bruddynix") { inherit sshUser; diff --git a/modules/shared/programs/terminal/tools/ssh/default.nix b/modules/shared/programs/terminal/tools/ssh/default.nix index ce857c504..7b4a04073 100644 --- a/modules/shared/programs/terminal/tools/ssh/default.nix +++ b/modules/shared/programs/terminal/tools/ssh/default.nix @@ -1,30 +1,30 @@ { config, - lib, - inputs, host, - namespace, + inputs, + khanelinix-lib, + lib, ... }: let - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.programs.terminal.tools.ssh; + cfg = config.khanelinix.programs.terminal.tools.ssh; name = host; - user = config.users.users.${config.${namespace}.user.name}; + user = config.users.users.${config.khanelinix.user.name}; user-id = builtins.toString user.uid; other-hosts = lib.filterAttrs ( - key: host: key != name && (host.config.${namespace}.user.name or null) != null + key: host: key != name && (host.config.khanelinix.user.name or null) != null ) ((inputs.self.nixosConfigurations or { }) // (inputs.self.darwinConfigurations or { })); other-hosts-config = lib.concatMapStringsSep "\n" ( name: let remote = other-hosts.${name}; - remote-user-name = remote.config.${namespace}.user.name; + remote-user-name = remote.config.khanelinix.user.name; remote-user-id = builtins.toString remote.config.users.users.${remote-user-name}.uid; forward-gpg = @@ -50,7 +50,7 @@ let ) (builtins.attrNames other-hosts); in { - options.${namespace}.programs.terminal.tools.ssh = with lib.types; { + options.khanelinix.programs.terminal.tools.ssh = with lib.types; { enable = mkBoolOpt false "Whether or not to configure ssh support."; extraConfig = mkOpt str "" "Extra configuration to apply."; port = mkOpt port 2222 "The port to listen on (in addition to 22)."; diff --git a/modules/shared/suites/common/default.nix b/modules/shared/suites/common/default.nix index b4efb796e..dbe81847d 100644 --- a/modules/shared/suites/common/default.nix +++ b/modules/shared/suites/common/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (khanelinix-lib) mkBoolOpt; - cfg = config.${namespace}.suites.common; + cfg = config.khanelinix.suites.common; in { - options.${namespace}.suites.common = { + options.khanelinix.suites.common = { enable = mkBoolOpt false "Whether or not to enable common configuration."; }; diff --git a/modules/shared/system/fonts/default.nix b/modules/shared/system/fonts/default.nix index 75cdc127c..a3fe0cacd 100644 --- a/modules/shared/system/fonts/default.nix +++ b/modules/shared/system/fonts/default.nix @@ -2,17 +2,17 @@ config, lib, pkgs, - namespace, + khanelinix-lib, ... }: let inherit (lib) types mkIf; - inherit (lib.${namespace}) mkBoolOpt mkOpt; + inherit (khanelinix-lib) mkBoolOpt mkOpt; - cfg = config.${namespace}.system.fonts; + cfg = config.khanelinix.system.fonts; in { - options.${namespace}.system.fonts = with types; { + options.khanelinix.system.fonts = with types; { enable = mkBoolOpt false "Whether or not to manage fonts."; fonts = with pkgs; diff --git a/overlays/csharp-ls/default.nix b/overlays/csharp-ls.nix similarity index 100% rename from overlays/csharp-ls/default.nix rename to overlays/csharp-ls.nix diff --git a/overlays/looking-glass/default.nix b/overlays/looking-glass-client.nix similarity index 100% rename from overlays/looking-glass/default.nix rename to overlays/looking-glass-client.nix diff --git a/overlays/nixpkgs-master.nix b/overlays/nixpkgs-master.nix new file mode 100644 index 000000000..adf277777 --- /dev/null +++ b/overlays/nixpkgs-master.nix @@ -0,0 +1,6 @@ +{ flake }: +_self: super: { + inherit (flake.inputs.nixpkgs-master.legacyPackages.${super.stdenv.system}) + ruff + ; +} diff --git a/overlays/nixpkgs-unstable/default.nix b/overlays/nixpkgs-unstable.nix similarity index 69% rename from overlays/nixpkgs-unstable/default.nix rename to overlays/nixpkgs-unstable.nix index 7a86b378e..893070e54 100644 --- a/overlays/nixpkgs-unstable/default.nix +++ b/overlays/nixpkgs-unstable.nix @@ -1,6 +1,6 @@ -{ channels, ... }: -_final: _prev: { - inherit (channels.nixpkgs-unstable) +{ flake }: +_self: super: { + inherit (flake.inputs.nixpkgs-unstable.legacyPackages.${super.stdenv.system}) # Core jankyborders raycast diff --git a/overlays/sketchybar/default.nix b/overlays/sketchybar.nix similarity index 100% rename from overlays/sketchybar/default.nix rename to overlays/sketchybar.nix diff --git a/packages/artifacts-credprovider/default.nix b/packages/artifacts-credprovider/package.nix similarity index 100% rename from packages/artifacts-credprovider/default.nix rename to packages/artifacts-credprovider/package.nix diff --git a/packages/avrogen/default.nix b/packages/avrogen/package.nix similarity index 100% rename from packages/avrogen/default.nix rename to packages/avrogen/package.nix diff --git a/packages/build-by-path/default.nix b/packages/build-by-path/package.nix similarity index 100% rename from packages/build-by-path/default.nix rename to packages/build-by-path/package.nix diff --git a/packages/dynamic-island-helper/default.nix b/packages/dynamic-island-helper/package.nix similarity index 100% rename from packages/dynamic-island-helper/default.nix rename to packages/dynamic-island-helper/package.nix diff --git a/packages/fix-git/default.nix b/packages/fix-git/package.nix similarity index 100% rename from packages/fix-git/default.nix rename to packages/fix-git/package.nix diff --git a/packages/git-cliff/default.nix b/packages/git-cliff/package.nix similarity index 100% rename from packages/git-cliff/default.nix rename to packages/git-cliff/package.nix diff --git a/packages/list-iommu/default.nix b/packages/list-iommu/package.nix similarity index 100% rename from packages/list-iommu/default.nix rename to packages/list-iommu/package.nix diff --git a/packages/record_screen/default.nix b/packages/record_screen/package.nix similarity index 100% rename from packages/record_screen/default.nix rename to packages/record_screen/package.nix diff --git a/packages/sbarlua/default.nix b/packages/sbarlua/package.nix similarity index 100% rename from packages/sbarlua/default.nix rename to packages/sbarlua/package.nix diff --git a/packages/sketchyhelper/default.nix b/packages/sketchyhelper/package.nix similarity index 100% rename from packages/sketchyhelper/default.nix rename to packages/sketchyhelper/package.nix diff --git a/packages/trace-symlink/default.nix b/packages/trace-symlink/package.nix similarity index 100% rename from packages/trace-symlink/default.nix rename to packages/trace-symlink/package.nix diff --git a/packages/trace-which/default.nix b/packages/trace-which/package.nix similarity index 63% rename from packages/trace-which/default.nix rename to packages/trace-which/package.nix index ce61b9b09..3e8235e2c 100644 --- a/packages/trace-which/default.nix +++ b/packages/trace-which/package.nix @@ -1,8 +1,8 @@ { writeShellApplication, - pkgs, + inputs, lib, - namespace, + system, ... }: writeShellApplication { @@ -16,6 +16,6 @@ writeShellApplication { text = # bash '' - a=$(which "$1") && exec ${lib.getExe pkgs.${namespace}.trace-symlink} "$a" + a=$(which "$1") && exec ${lib.getExe inputs.self.packages.${system}.trace-symlink} "$a" ''; } diff --git a/packages/user-icon/default.nix b/packages/user-icon/package.nix similarity index 100% rename from packages/user-icon/default.nix rename to packages/user-icon/package.nix diff --git a/packages/wallpapers/default.nix b/packages/wallpapers/package.nix similarity index 68% rename from packages/wallpapers/default.nix rename to packages/wallpapers/package.nix index eba537744..954efd925 100644 --- a/packages/wallpapers/default.nix +++ b/packages/wallpapers/package.nix @@ -1,6 +1,5 @@ { lib, - namespace, stdenvNoCC, ... }: @@ -26,22 +25,19 @@ let }; in pkg; - names = builtins.map lib.snowfall.path.get-file-name-without-extension images; + getFileNameWithoutExtension = fileName: builtins.head (builtins.split "." fileName); + names = builtins.map getFileNameWithoutExtension images; wallpapers = lib.foldl ( acc: image: let - # fileName = builtins.baseNameOf image; - # lib.getFileName is a helper to get the basename of - # the file and then take the name before the file extension. - # eg. mywallpaper.png -> mywallpaper - name = lib.snowfall.path.get-file-name-without-extension image; + name = getFileNameWithoutExtension image; in acc // { "${name}" = mkWallpaper name (./wallpapers + "/${image}"); } ) { } images; installTarget = "$out/share/wallpapers"; in stdenvNoCC.mkDerivation { - name = "${namespace}.wallpapers"; + name = "khanelinix.wallpapers"; src = ./wallpapers; installPhase = # bash diff --git a/packages/yabai-helper/default.nix b/packages/yabai-helper/package.nix similarity index 96% rename from packages/yabai-helper/default.nix rename to packages/yabai-helper/package.nix index 404ec93f8..43f20bffa 100644 --- a/packages/yabai-helper/default.nix +++ b/packages/yabai-helper/package.nix @@ -1,8 +1,9 @@ { - writeShellApplication, - pkgs, lib, - namespace, + pkgs, + system, + writeShellApplication, + inputs, ... }: let @@ -220,7 +221,10 @@ writeShellApplication { yabai -m window "$YABAI_WINDOW_ID" --space "$2" fi yabai -m space --focus "$2" - set_wallpaper ${pkgs.${namespace}.wallpapers}/share/wallpapers/$(ls ${pkgs.${namespace}.wallpapers}/share/wallpapers/ | shuf -n 1) + + set_wallpaper ${inputs.self.packages.${system}.wallpapers}/share/wallpapers/$(ls ${ + inputs.self.packages.${system}.wallpapers + }/share/wallpapers/ | shuf -n 1) return 0 fi @@ -233,7 +237,9 @@ writeShellApplication { echo "$i" yabai -m space --create yabai -m space --focus "$i" - set_wallpaper ${pkgs.${namespace}.wallpapers}/share/wallpapers/$(ls ${pkgs.${namespace}.wallpapers}/share/wallpapers/ | shuf -n 1) + set_wallpaper ${inputs.self.packages.${system}.wallpapers}/share/wallpapers/$(ls ${ + inputs.self.packages.${system}.wallpapers + }/share/wallpapers/ | shuf -n 1) done yabai -m space "$CURRENT_SPACE" --focus @@ -245,7 +251,7 @@ writeShellApplication { set_wallpapers() { if [[ $(command -v yabai) ]]; then - LOCAL_WALLPAPERS="$(realpath ${pkgs.${namespace}.wallpapers}/share/wallpapers/)" + LOCAL_WALLPAPERS="$(realpath ${inputs.self.packages.${system}.wallpapers}/share/wallpapers/)" yabai -m space --focus 1 diff --git a/shells/default/default.nix b/shells/default/default.nix index 0972ff94b..a85fc9bc4 100644 --- a/shells/default/default.nix +++ b/shells/default/default.nix @@ -3,7 +3,7 @@ mkShell, pkgs, system, - namespace, + ... }: let @@ -34,7 +34,7 @@ mkShell { shellHook = '' ${inputs.self.checks.${system}.pre-commit-hooks.shellHook} - echo 🔨 Welcome to ${namespace} + echo 🔨 Welcome to khanelinix ''; diff --git a/shells/dotnet/default.nix b/shells/dotnet/default.nix index 9140e6a4e..1724eeddb 100644 --- a/shells/dotnet/default.nix +++ b/shells/dotnet/default.nix @@ -1,7 +1,7 @@ { mkShell, pkgs, ... }: mkShell { packages = with pkgs; [ - pkgs.khanelinix.avrogen + self.packages.${system}.avrogen azure-cli bicep csharpier @@ -22,7 +22,9 @@ mkShell { shellHook = '' - export NUGET_PLUGIN_PATHS=${pkgs.khanelinix.artifacts-credprovider}/bin/netcore/CredentialProvider.Microsoft/CredentialProvider.Microsoft.dll + export NUGET_PLUGIN_PATHS=${ + self.packages.${system}.artifacts-credprovider + }/bin/netcore/CredentialProvider.Microsoft/CredentialProvider.Microsoft.dll echo 🔨 Dotnet DevShell diff --git a/shells/nix/default.nix b/shells/nix/default.nix index 018954319..2070f5e2f 100644 --- a/shells/nix/default.nix +++ b/shells/nix/default.nix @@ -3,7 +3,7 @@ mkShell, pkgs, system, - namespace, + ... }: let @@ -31,7 +31,7 @@ mkShell { ]; shellHook = '' - echo 🔨 Welcome to ${namespace} + echo 🔨 Welcome to khanelinix ''; diff --git a/systems/aarch64-linux/nixos/default.nix b/systems/aarch64-linux/nixos/default.nix deleted file mode 100644 index 83f388924..000000000 --- a/systems/aarch64-linux/nixos/default.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ lib, namespace, ... }: -let - inherit (lib.${namespace}) enabled; -in -{ - imports = [ ./hardware.nix ]; - - programs.sway.extraSessionCommands = # bash - '' - WLR_NO_HARDWARE_CURSORS=1 - ''; - - khanelinix = { - nix = enabled; - - archetypes = { - vm = enabled; - }; - - apps = { - _1password = enabled; - firefox = enabled; - # vscode = enabled; - }; - - cli-apps = { - neovim = enabled; - }; - - desktop = { - gnome = { - enable = true; - }; - }; - - hardware = { - storage = { - enable = true; - ssdEnable = true; - }; - }; - - services = { - printing = enabled; - }; - - security = { - doas = enabled; - keyring = enabled; - }; - - system = { - boot = enabled; - fonts = enabled; - locale = enabled; - networking = enabled; - time = enabled; - xkb = enabled; - }; - }; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "21.11"; # Did you read the comment? -} diff --git a/systems/aarch64-linux/nixos/hardware.nix b/systems/aarch64-linux/nixos/hardware.nix deleted file mode 100644 index a7546f02e..000000000 --- a/systems/aarch64-linux/nixos/hardware.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ pkgs, modulesPath, ... }: -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - - boot = { - kernelPackages = pkgs.linuxPackages_latest; - - initrd = { - availableKernelModules = [ - "nvme" - "ahci" - "xhci_pci" - "usbhid" - "usb_storage" - "sd_mod" - ]; - }; - - extraModulePackages = [ ]; - }; - - fileSystems."/" = { - device = "/dev/disk/by-label/nixos"; - fsType = "ext4"; - }; - - fileSystems."/boot/efi" = { - device = "/dev/disk/by-label/BOOT"; - fsType = "vfat"; - }; - - swapDevices = [ { device = "/dev/disk/by-label/swap"; } ]; - - hardware.enableRedistributableFirmware = true; - - hardware.bluetooth.enable = true; -} diff --git a/systems/x86_64-install-iso/graphical/default.nix b/systems/x86_64-install-iso/graphical/default.nix deleted file mode 100644 index 92388e586..000000000 --- a/systems/x86_64-install-iso/graphical/default.nix +++ /dev/null @@ -1,79 +0,0 @@ -{ - pkgs, - lib, - namespace, - ... -}: -let - inherit (lib) mkForce; - inherit (lib.${namespace}) enabled; -in -{ - # `install-iso` adds wireless support that - # is incompatible with networkmanager. - networking.wireless.enable = mkForce false; - - environment.systemPackages = with pkgs; [ - git - wget - curl - pciutils - file - ]; - - khanelinix = { - nix = enabled; - - apps = { - _1password = enabled; - firefox = enabled; - gparted = enabled; - }; - - cli-apps = { - neovim = enabled; - tmux = enabled; - }; - - desktop = { - gnome = { - enable = true; - }; - }; - - tools = { - k8s = enabled; - }; - - hardware = { - audio = enabled; - }; - - services = { - openssh = enabled; - printing = enabled; - }; - - security = { - doas = enabled; - keyring = enabled; - }; - - system = { - boot = enabled; - fonts = enabled; - locale = enabled; - time = enabled; - xkb = enabled; - networking = enabled; - }; - }; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "21.11"; # Did you read the comment? -} diff --git a/systems/x86_64-install-iso/minimal/default.nix b/systems/x86_64-install-iso/minimal/default.nix deleted file mode 100644 index 0851d4e6d..000000000 --- a/systems/x86_64-install-iso/minimal/default.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ - pkgs, - lib, - namespace, - ... -}: -let - inherit (lib) mkForce; - inherit (lib.${namespace}) enabled; -in -{ - # `install-iso` adds wireless support that - # is incompatible with networkmanager. - networking.wireless.enable = mkForce false; - - environment.systemPackages = with pkgs; [ - git - wget - curl - pciutils - file - ]; - - khanelinix = { - nix = enabled; - - programs = { - terminal = { - editors = { - neovim = enabled; - tmux = enabled; - }; - }; - }; - - services = { - openssh = enabled; - }; - - security = { - doas = enabled; - }; - - system = { - boot = enabled; - fonts = enabled; - locale = enabled; - time = enabled; - xkb = enabled; - networking = enabled; - }; - }; -} diff --git a/systems/x86_64-iso/isolated/default.nix b/systems/x86_64-iso/isolated/default.nix deleted file mode 100644 index 15ec50810..000000000 --- a/systems/x86_64-iso/isolated/default.nix +++ /dev/null @@ -1,120 +0,0 @@ -{ - lib, - pkgs, - namespace, - ... -}: -let - inherit (lib) mkForce getExe getExe'; - inherit (lib.${namespace}) enabled; - - gpgConf = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/drduh/config/master/gpg.conf"; - sha256 = "0va62sgnah8rjgp4m6zygs4z9gbpmqvq9m3x4byywk1dha6nvvaj"; - }; - gpgAgentConf = '' - pinentry-program ${getExe' pkgs.pinentry-curses "pinentry-curses"} - ''; - guide = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/drduh/YubiKey-Guide/master/README.md"; - sha256 = "164pyqm3yjybxlvwxzfb9mpp38zs9rb2fycngr6jv20n3vr1dipj"; - }; - theme = pkgs.fetchFromGitHub { - owner = "jez"; - repo = "pandoc-markdown-css-theme"; - rev = "019a4829242937761949274916022e9861ed0627"; - sha256 = "1h48yqffpaz437f3c9hfryf23r95rr319lrb3y79kxpxbc9hihxb"; - }; - guideHTML = pkgs.runCommand "yubikey-guide" { } '' - ${getExe pkgs.pandoc} \ - --standalone \ - --metadata title="Yubikey Guide" \ - --from markdown \ - --to html5+smart \ - --toc \ - --template ${theme}/template.html5 \ - --css ${theme}/docs/css/theme.css \ - --css ${theme}/docs/css/skylighting-solarized-theme.css \ - -o $out \ - ${guide} - ''; -in -{ - environment.systemPackages = with pkgs; [ - cryptsetup - git - gnupg - pinentry-curses - pinentry-qt - paperkey - wget - pciutils - file - ]; - - programs = { - ssh.startAgent = false; - gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - }; - - khanelinix = { - nix = enabled; - - desktop = { - gnome = { - enable = true; - }; - }; - - apps = { - firefox = enabled; - }; - - cli-apps = { - neovim = enabled; - }; - - home = { - file = { - "guide.md".source = guide; - "guide.html".source = guideHTML; - "gpg.conf".source = gpgConf; - "gpg-agent.conf".text = gpgAgentConf; - - ".gnupg/gpg.conf".source = gpgConf; - ".gnupg/gpg-agent.conf".text = gpgAgentConf; - }; - }; - - security = { - doas = enabled; - }; - - system = { - fonts = enabled; - locale = enabled; - time = enabled; - xkb = enabled; - networking = { - # Networking is explicitly disabled in this environment. - enable = mkForce false; - }; - }; - }; - - services = { - pcscd.enable = true; - udev.packages = with pkgs; [ yubikey-personalization ]; - }; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "21.11"; # Did you read the comment? -} diff --git a/systems/x86_64-iso/rescue/default.nix b/systems/x86_64-iso/rescue/default.nix deleted file mode 100644 index 76277890c..000000000 --- a/systems/x86_64-iso/rescue/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - pkgs, - lib, - namespace, - ... -}: -let - inherit (lib.${namespace}) enabled; -in -{ - environment.systemPackages = with pkgs; [ - git - wget - curl - pciutils - file - ]; - - khanelinix = { - nix = enabled; - - cli-apps = { - neovim = enabled; - }; - - security = { - doas = enabled; - }; - - system = { - fonts = enabled; - locale = enabled; - time = enabled; - xkb = enabled; - }; - }; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "21.11"; # Did you read the comment? -} diff --git a/templates/angular/flake.nix b/templates/angular/flake.nix index c152f6a1d..ce285f8cd 100644 --- a/templates/angular/flake.nix +++ b/templates/angular/flake.nix @@ -25,5 +25,11 @@ }); hydraJobs = packages; + + checks = forEachSystem (system: { + default = pkgsForEach.${system}.runCommand "check" { } '' + echo "Running checks for ${system}" + ''; + }); }; } diff --git a/templates/dotnetf/flake.nix b/templates/dotnetf/flake.nix index 2a64433cf..5fe8c7a51 100644 --- a/templates/dotnetf/flake.nix +++ b/templates/dotnetf/flake.nix @@ -5,7 +5,11 @@ flake-utils.url = "github:numtide/flake-utils"; }; outputs = - { nixpkgs, flake-utils, ... }: + { + nixpkgs, + flake-utils, + ... + }: flake-utils.lib.eachDefaultSystem ( system: let diff --git a/treefmt.nix b/treefmt.nix deleted file mode 100644 index e6911b253..000000000 --- a/treefmt.nix +++ /dev/null @@ -1,96 +0,0 @@ -{ - projectRootFile = "flake.nix"; - - programs = { - actionlint.enable = true; - biome = { - enable = true; - settings.formatter.formatWithErrors = true; - }; - clang-format.enable = true; - deadnix = { - enable = true; - }; - deno = { - enable = true; - # Using biome for these - excludes = [ - "*.ts" - "*.js" - "*.json" - "*.jsonc" - ]; - }; - fantomas.enable = true; - fish_indent.enable = true; - gofmt.enable = true; - isort.enable = true; - nixfmt.enable = true; - nufmt.enable = true; - ruff-check.enable = true; - ruff-format.enable = true; - rustfmt.enable = true; - shfmt = { - enable = true; - indent_size = 4; - }; - statix.enable = true; - stylua.enable = true; - taplo.enable = true; - yamlfmt.enable = true; - }; - - settings = { - global.excludes = [ - "*.editorconfig" - "*.envrc" - "*.gitconfig" - "*.git-blame-ignore-revs" - "*.gitignore" - "*.gitattributes" - "*.luacheckrc" - "*CODEOWNERS" - "*LICENSE" - "*flake.lock" - "*.svg" - "*.png" - "*.gif" - "*.ico" - # TODO: formatters? - "*Makefile" - "*makefile" - "*.xml" - "*.zsh" - "*.rasi" - "*.kdl" - - # TODO: exceptions - # WARN no formatter for path: homes/x86_64-linux/nixos@CORE-PW00LM92/git/windows-compat-config - # WARN no formatter for path: modules/darwin/desktop/wms/yabai/extraConfig - # WARN no formatter for path: modules/home/programs/graphical/addons/electron-support/electron-flags.conf - # WARN no formatter for path: modules/home/programs/graphical/addons/kanshi/config - # WARN no formatter for path: modules/home/programs/graphical/addons/mako/config - # WARN no formatter for path: modules/home/programs/graphical/addons/swappy/config - # WARN no formatter for path: modules/home/programs/graphical/bars/sketchybar/dynamic-island-sketchybar/helper/islandhelper - # WARN no formatter for path: modules/home/programs/graphical/bars/sketchybar/dynamic-island-sketchybar/scripts/islands/music/cava.conf - # WARN no formatter for path: modules/home/programs/graphical/bars/sketchybar/dynamic-island-sketchybar/scripts/islands/music/get_artwork.scpt - # WARN no formatter for path: modules/home/programs/graphical/bars/sketchybar/dynamic-island-sketchybar/scripts/islands/volume/data/cache - # WARN no formatter for path: modules/home/programs/graphical/bars/sketchybar/dynamic-island-sketchybar/sketchybarrc - # WARN no formatter for path: modules/home/programs/graphical/launchers/wofi/config - # WARN no formatter for path: modules/home/programs/terminal/editors/micro/catppuccin-macchiato.micro - # WARN no formatter for path: modules/home/programs/terminal/tools/tmux/config/general.tmux - # WARN no formatter for path: modules/home/theme/qt/Kvantum/Catppuccin-Macchiato-Blue/Catppuccin-Macchiato-Blue.kvconfig - # WARN no formatter for path: modules/home/theme/qt/Kvantum/kvantum.kvconfig - # WARN no formatter for path: modules/nixos/programs/graphical/addons/looking-glass-client/client.ini - # WARN no formatter for path: systems/x86_64-linux/khanelinix/hyprlandOutput - # WARN no formatter for path: systems/x86_64-linux/khanelinix/swayOutput - # WARN no formatter for path: templates/c/Makefile.in - # WARN no formatter for path: templates/c/configure.ac - # WARN no formatter for path: templates/dotnetf/HelloWorld.Test/HelloWorld.Test.fsproj - # WARN no formatter for path: templates/dotnetf/HelloWorld.sln - # WARN no formatter for path: templates/dotnetf/HelloWorld/HelloWorld.fsproj - ]; - - formatter.ruff-format.options = [ "--isolated" ]; - }; -}