diff --git a/clan.nix b/clan.nix index 2524ad2..1140fa9 100644 --- a/clan.nix +++ b/clan.nix @@ -1,7 +1,4 @@ { - baseNixosModules, - lib, -}: { meta = { name = "arda"; domain = "arda"; @@ -11,60 +8,60 @@ directory = ./.; inventory.machines = { - aule = { - name = "aule"; - description = "Planned build server."; - machineClass = "nixos"; - tags = ["planned" "build"]; - }; - mandos = { - name = "mandos"; - description = "Living room Steam box."; - machineClass = "nixos"; - tags = ["gaming" "living-room"]; - }; - manwe = { - name = "manwe"; - description = "Main desktop."; - machineClass = "nixos"; - tags = ["desktop"]; - }; - melkor = { - name = "melkor"; - description = "Planned machine with no defined role yet."; - machineClass = "nixos"; - tags = []; - }; - orome = { - name = "orome"; - description = "Work laptop."; - machineClass = "nixos"; - tags = ["laptop" "work"]; - }; - tulkas = { - name = "tulkas"; - description = "Steam Deck."; - machineClass = "nixos"; - tags = ["gaming" "handheld"]; - }; + # aule = { + # name = "aule"; + # description = "Planned build server."; + # machineClass = "nixos"; + # tags = ["planned" "build"]; + # }; + # mandos = { + # name = "mandos"; + # description = "Living room Steam box."; + # machineClass = "nixos"; + # tags = ["gaming" "living-room"]; + # }; + # manwe = { + # name = "manwe"; + # description = "Main desktop."; + # machineClass = "nixos"; + # tags = ["desktop"]; + # }; + # melkor = { + # name = "melkor"; + # description = "Planned machine with no defined role yet."; + # machineClass = "nixos"; + # tags = []; + # }; + # orome = { + # name = "orome"; + # description = "Work laptop."; + # machineClass = "nixos"; + # tags = ["laptop" "work"]; + # }; + # tulkas = { + # name = "tulkas"; + # description = "Steam Deck."; + # machineClass = "nixos"; + # tags = ["gaming" "handheld"]; + # }; ulmo = { name = "ulmo"; description = "Primary self-hosted services machine."; machineClass = "nixos"; tags = ["server" "services"]; }; - varda = { - name = "varda"; - description = "Planned machine with no defined role yet."; - machineClass = "nixos"; - tags = []; - }; - yavanna = { - name = "yavanna"; - description = "Planned machine with no defined role yet."; - machineClass = "nixos"; - tags = []; - }; + # varda = { + # name = "varda"; + # description = "Planned machine with no defined role yet."; + # machineClass = "nixos"; + # tags = []; + # }; + # yavanna = { + # name = "yavanna"; + # description = "Planned machine with no defined role yet."; + # machineClass = "nixos"; + # tags = []; + # }; }; inventory.instances = { @@ -79,7 +76,7 @@ roles.default.settings = { user = "chris"; - groups = [ "wheel" ]; + groups = ["wheel"]; prompt = true; share = true; }; @@ -87,53 +84,10 @@ }; machines = { - mandos = { - imports = baseNixosModules ++ [ - { - networking.hostName = lib.mkDefault "mandos"; - } - ./machines/mandos/configuration.nix - ./users/chris/mandos.nix - ]; - }; - - manwe = { - imports = baseNixosModules ++ [ - { - networking.hostName = lib.mkDefault "manwe"; - } - ./machines/manwe/configuration.nix - ./users/chris/manwe.nix - ]; - }; - - orome = { - imports = baseNixosModules ++ [ - { - networking.hostName = lib.mkDefault "orome"; - } - ./machines/orome/configuration.nix - ./users/chris/orome.nix - ]; - }; - - tulkas = { - imports = baseNixosModules ++ [ - { - networking.hostName = lib.mkDefault "tulkas"; - } - ./machines/tulkas/configuration.nix - ./users/chris/tulkas.nix - ]; - }; - - ulmo = { - imports = baseNixosModules ++ [ - { - networking.hostName = lib.mkDefault "ulmo"; - } - ./machines/ulmo/configuration.nix - ]; - }; + # mandos = {}; + # manwe = {}; + # orome = {}; + # tulkas = {}; + ulmo = {}; }; } diff --git a/shells/default/default.nix b/devShell.nix similarity index 100% rename from shells/default/default.nix rename to devShell.nix diff --git a/flake.lock b/flake.lock index 24acfef..95c27cc 100644 --- a/flake.lock +++ b/flake.lock @@ -184,11 +184,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1774250935, - "narHash": "sha256-mWID0WFgTnd9hbEeaPNX+YYWF70JN3r7zBouEqERJOE=", + "lastModified": 1774423251, + "narHash": "sha256-g/PP8G9WcP4vtZVOBNYwfGxLnwLQoTERHnef8irAMeQ=", "owner": "nix-community", "repo": "fenix", - "rev": "64d7705e8c37d650cfb1aa99c24a8ce46597f29e", + "rev": "b70d7535088cd8a9e4322c372a475f66ffa18adf", "type": "github" }, "original": { @@ -445,11 +445,11 @@ ] }, "locked": { - "lastModified": 1773992301, - "narHash": "sha256-lm1qy9P463cblBAFC2g8VaALR1Gje1oyYXCPtiEumus=", + "lastModified": 1774387289, + "narHash": "sha256-Z/0IfVHrb0lEdv1WcHEe/ni4utBMR2GXZIktzYcTDSU=", "owner": "himmelblau-idm", "repo": "himmelblau", - "rev": "fcb8966990c24f97fe224fa0c8977fe730d4cf50", + "rev": "b2eccc7cb188253e49bffdddd743d01f52ab9625", "type": "github" }, "original": { @@ -465,11 +465,11 @@ ] }, "locked": { - "lastModified": 1774210133, - "narHash": "sha256-yeiWCY9aAUUJ3ebMVjs0UZXRnT5x90MCtpbpOWiXrvM=", + "lastModified": 1774379316, + "narHash": "sha256-0nGNxWDUH2Hzlj/R3Zf4FEK6fsFNB/dvewuboSRZqiI=", "owner": "nix-community", "repo": "home-manager", - "rev": "c6fe2944ad9f2444b2d767c4a5edee7c166e8a95", + "rev": "1eb0549a1ab3fe3f5acf86668249be15fa0e64f7", "type": "github" }, "original": { @@ -499,6 +499,21 @@ "type": "github" } }, + "import-tree": { + "locked": { + "lastModified": 1773693634, + "narHash": "sha256-BtZ2dtkBdSUnFPPFc+n0kcMbgaTxzFNPv2iaO326Ffg=", + "owner": "vic", + "repo": "import-tree", + "rev": "c41e7d58045f9057880b0d85e1152d6a4430dbf1", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "import-tree", + "type": "github" + } + }, "jovian": { "inputs": { "nix-github-actions": "nix-github-actions", @@ -507,11 +522,11 @@ ] }, "locked": { - "lastModified": 1774168156, - "narHash": "sha256-+pwZSARdlM2RQQ6V0q76+WMKW9aNIcxkSOIThcz/f0A=", + "lastModified": 1774333446, + "narHash": "sha256-jeAUd4mfLle7Zw8F3lDdXvw2cmeP3FgVphHq2XuEKbs=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "939caad56508542d0f19cab963e2bc693f5f2831", + "rev": "79b45622eff2ae0437d7a712610044bbc7b87fa2", "type": "github" }, "original": { @@ -645,11 +660,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1774060651, - "narHash": "sha256-sZiam+rmNcOZGnlbnqDD9oTwfMdQUM+uQmFqqSoe194=", + "lastModified": 1774407052, + "narHash": "sha256-rUkn7Bo3PAlpcZl8+0FDsTwFyDwvS4xwMT9+RJ+XJoE=", "owner": "Infinidoge", "repo": "nix-minecraft", - "rev": "46727bd27d32d63069ed26a690554373ae2b4702", + "rev": "70daf1f48885f0b4a70797076cd2ff5d9139b46e", "type": "github" }, "original": { @@ -752,11 +767,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1774259547, - "narHash": "sha256-5EQ1TL+R/tcsoGas1oALp5Tj2ACfSul+pfrrxP72xC0=", + "lastModified": 1774449288, + "narHash": "sha256-ukB6NS45Oi62fQM4RpZfx3dpqxIu66ADCCFl6h72Fjo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b3f8d82c4c685fb6f3080745dab8f07606ae50d3", + "rev": "cd0256cd8c537170cf24827fa821efb57aed9f40", "type": "github" }, "original": { @@ -816,11 +831,11 @@ }, "nixpkgs_9": { "locked": { - "lastModified": 1774273680, - "narHash": "sha256-a++tZ1RQsDb1I0NHrFwdGuRlR5TORvCEUksM459wKUA=", + "lastModified": 1773840656, + "narHash": "sha256-9tpvMGFteZnd3gRQZFlRCohVpqooygFuy9yjuyRL2C0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fdc7b8f7b30fdbedec91b71ed82f36e1637483ed", + "rev": "9cf7092bdd603554bd8b63c216e8943cf9b12512", "type": "github" }, "original": { @@ -865,11 +880,11 @@ "systems": "systems_3" }, "locked": { - "lastModified": 1774224548, - "narHash": "sha256-g45WZAZHNc7wJBkK4IdB5dq0Bh0JE7G0gcY2H5DFi44=", + "lastModified": 1774375131, + "narHash": "sha256-d22VIgsDXagQQWnAnebYeQWGHlmF81YRwuGCzAgNZAQ=", "owner": "notashelf", "repo": "nvf", - "rev": "edfb73fa4ced576f587d259a70a513b4152f8cea", + "rev": "d847d401bea4dcb1478d02a61a3209fa8512f71d", "type": "github" }, "original": { @@ -911,6 +926,7 @@ "grub2-themes": "grub2-themes", "himmelblau": "himmelblau", "home-manager": "home-manager", + "import-tree": "import-tree", "jovian": "jovian", "mydia": "mydia", "nix-minecraft": "nix-minecraft", @@ -922,6 +938,7 @@ "plasma-manager": "plasma-manager", "sops-nix": "sops-nix_2", "stylix": "stylix", + "systems": "systems_5", "terranix": "terranix", "zen-browser": "zen-browser" } @@ -929,11 +946,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1774221325, - "narHash": "sha256-aEIdkqB8gtQZtEbogdUb5iyfcZpKIlD3FkG8ANu73/I=", + "lastModified": 1774376228, + "narHash": "sha256-7oA0u4aghFjjIcIDKZ26NUpXH7hVXGPC0sI1OfK7NUk=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "b42b63f390a4dab14e6efa34a70e67f5b087cc62", + "rev": "eabb84b771420b8396ab4bb4747694302d9be277", "type": "github" }, "original": { @@ -969,11 +986,11 @@ "nixpkgs": "nixpkgs_9" }, "locked": { - "lastModified": 1774154798, - "narHash": "sha256-zsTuloDSdKf+PrI1MsWx5z/cyGEJ8P3eERtAfdP8Bmg=", + "lastModified": 1774303811, + "narHash": "sha256-fhG4JAcLgjKwt+XHbjs8brpWnyKUfU4LikLm3s0Q/ic=", "owner": "Mic92", "repo": "sops-nix", - "rev": "3e0d543e6ba6c0c48117a81614e90c6d8c425170", + "rev": "614e256310e0a4f8a9ccae3fa80c11844fba7042", "type": "github" }, "original": { @@ -1089,13 +1106,28 @@ "type": "github" } }, + "systems_6": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "terranix": { "inputs": { "flake-parts": "flake-parts_5", "nixpkgs": [ "nixpkgs" ], - "systems": "systems_5" + "systems": "systems_6" }, "locked": { "lastModified": 1773700838, @@ -1221,11 +1253,11 @@ ] }, "locked": { - "lastModified": 1774242250, - "narHash": "sha256-pchbnY7KVnH26g4O3LZO8vpshInqNj937gAqlPob1Mk=", + "lastModified": 1774352774, + "narHash": "sha256-gibUM0pSnLxEeuFrYA8T1oEaixk+fjQpqXbYaxcEX/4=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "f19c3e6683c2d2f3fcfcb88fb691931a104bc47c", + "rev": "a0f3d47dbd8f8618a1920d5a5ca09b7993415895", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 1225179..f068733 100644 --- a/flake.nix +++ b/flake.nix @@ -1,11 +1,17 @@ { description = "Nixos config flake"; + nixConfig = { + warn-dirty = false; + extra-experimental-features = ["nix-command" "flakes" "pipe-operators"]; + }; + inputs = { flake-parts = { url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "clan-core/nixpkgs"; }; + import-tree.url = "github:vic/import-tree"; clan-core = { url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz"; @@ -13,6 +19,7 @@ }; nixpkgs.follows = "clan-core/nixpkgs"; + systems.url = "github:nix-systems/default"; home-manager = { url = "github:nix-community/home-manager"; @@ -25,21 +32,9 @@ inputs.home-manager.follows = "home-manager"; }; - # Legacy ISO flow removed in favor of Clan install workflows. - # nixos-generators = { - # url = "github:nix-community/nixos-generators"; - # inputs.nixpkgs.follows = "nixpkgs"; - # }; - # neovim nvf.url = "github:notashelf/nvf"; - # Unused input retained as a comment for easy recovery. - # nixos-boot.url = "github:Melkor333/nixos-boot"; - - # Unused input retained as a comment for easy recovery. - # firefox.url = "github:nix-community/flake-firefox-nightly"; - stylix.url = "github:nix-community/stylix"; # Rust toolchain @@ -78,15 +73,6 @@ url = "github:vinceliuice/grub2-themes"; }; - # Unused input retained as a comment for easy recovery. - # nixos-wsl = { - # url = "github:nix-community/nixos-wsl"; - # inputs = { - # nixpkgs.follows = "nixpkgs"; - # flake-compat.follows = ""; - # }; - # }; - terranix = { url = "github:terranix/terranix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -98,23 +84,41 @@ }; }; - outputs = inputs@{flake-parts, ...}: + outputs = inputs @ { + flake-parts, + nixpkgs, + systems, + ... + }: flake-parts.lib.mkFlake {inherit inputs;} { - systems = [ - "x86_64-linux" - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" + systems = import systems; + clan = import ./clan.nix; + + imports = with inputs; [ + flake-parts.flakeModules.modules + clan-core.flakeModules.default ]; - imports = [ - inputs.clan-core.flakeModules.default - inputs.home-manager.flakeModules.home-manager - ./lib/default.nix - ./machines/default.nix - ./packages/default.nix - ./shells/default/default.nix - ./users/default.nix - ]; + perSystem = {system, ...}: { + _module.args = { + pkgs = import nixpkgs { + inherit system; + + overlays = with inputs; [ + fenix.overlays.default + nix-minecraft.overlay + flux.overlays.default + ]; + + config = { + allowUnfree = true; + permittedInsecurePackages = [ + # I think this is because of zen + "qtwebengine-5.15.19" + ]; + }; + }; + }; + }; }; } diff --git a/lib/default.nix b/lib/default.nix index c89e6cf..c59ca61 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -7,34 +7,6 @@ inherit (lib) mkOption types; namespace = "sneeuwvlok"; - channelConfig = { - allowUnfree = true; - permittedInsecurePackages = [ - # Due to *arr stack - "dotnet-sdk-6.0.428" - "aspnetcore-runtime-6.0.36" - - # I think this is because of zen - "qtwebengine-5.15.19" - - # For Nheko, the matrix client - "olm-3.2.16" - ]; - }; - - systemOverlays = with inputs; [ - fenix.overlays.default - nix-minecraft.overlay - flux.overlays.default - ]; - - mkPkgs = system: - import inputs.nixpkgs { - inherit system; - overlays = systemOverlays; - config = channelConfig; - }; - sharedContext = { inherit inputs namespace; erosanixLib = inputs.erosanix.lib; @@ -54,11 +26,6 @@ inputs.nvf.nixosModules.default inputs.sops-nix.nixosModules.sops { - nixpkgs = { - config = channelConfig; - overlays = systemOverlays; - }; - home-manager = { useGlobalPkgs = true; useUserPackages = true; @@ -67,7 +34,7 @@ }; } ] - ++ [ ../modules/nixos ]; + ++ [../modules/nixos]; in { imports = [ ./options diff --git a/machines/ulmo/configuration.nix b/machines/ulmo/configuration.nix index b79d25e..4c9ebbb 100644 --- a/machines/ulmo/configuration.nix +++ b/machines/ulmo/configuration.nix @@ -1,276 +1,301 @@ -{...}: { +{ + pkgs, + inputs, + ... +}: { imports = [ ./disks.nix ./hardware.nix + ../../modules/nixos ]; + sneeuwvlok.application.steam.enable = true; + nixpkgs.hostPlatform = "x86_64-linux"; + system.stateVersion = "23.11"; - networking = { - interfaces.enp2s0 = { - ipv6.addresses = [ - { - address = "2a0d:6e00:1dc9:0::dead:beef"; - prefixLength = 64; - } - ]; + boot = { + kernelPackages = pkgs.linuxPackages_latest; - useDHCP = true; + loader = { + systemd-boot.enable = false; + efi.canTouchEfiVariables = true; + grub = { + enable = true; + efiSupport = true; + efiInstallAsRemovable = false; + device = "nodev"; # INFO: https://discourse.nixos.org/t/question-about-grub-and-nodev + }; }; - defaultGateway = { - address = "192.168.1.1"; - interface = "enp2s0"; - }; - - defaultGateway6 = { - address = "fe80::1"; - interface = "enp2s0"; - }; + supportedFilesystems = ["nfs"]; }; - # virtualisation = { - # containers.enable = true; - # podman = { - # enable = true; - # dockerCompat = true; + # sneeuwvlok.application.steam.enable = true; + + # networking = { + # interfaces.enp2s0 = { + # ipv6.addresses = [ + # { + # address = "2a0d:6e00:1dc9:0::dead:beef"; + # prefixLength = 64; + # } + # ]; + + # useDHCP = true; # }; - # oci-containers = { - # backend = "podman"; - # containers = { - # homey = { - # image = "ghcr.io/athombv/homey-shs:latest"; - # autoStart = true; - # privileged = true; - # volumes = [ - # "/home/chris/.homey-shs:/homey/user" - # ]; - # ports = [ - # "4859:4859" - # ]; - # }; - # }; + # defaultGateway = { + # address = "192.168.1.1"; + # interface = "enp2s0"; + # }; + + # defaultGateway6 = { + # address = "fe80::1"; + # interface = "enp2s0"; # }; # }; - sneeuwvlok = { - services = { - backup.borg.enable = true; + # # virtualisation = { + # # containers.enable = true; + # # podman = { + # # enable = true; + # # dockerCompat = true; + # # }; - authentication.zitadel = { - enable = true; + # # oci-containers = { + # # backend = "podman"; + # # containers = { + # # homey = { + # # image = "ghcr.io/athombv/homey-shs:latest"; + # # autoStart = true; + # # privileged = true; + # # volumes = [ + # # "/home/chris/.homey-shs:/homey/user" + # # ]; + # # ports = [ + # # "4859:4859" + # # ]; + # # }; + # # }; + # # }; + # # }; - organization = { - nix = { - user = { - chris = { - email = "chris@kruining.eu"; - firstName = "Chris"; - lastName = "Kruining"; + # # sneeuwvlok = { + # # services = { + # # backup.borg.enable = true; - roles = ["ORG_OWNER"]; - instanceRoles = ["IAM_OWNER"]; - }; + # # authentication.zitadel = { + # # enable = true; - kaas = { - email = "chris+kaas@kruining.eu"; - firstName = "Kaas"; - lastName = "Kruining"; - }; - }; + # # organization = { + # # nix = { + # # user = { + # # chris = { + # # email = "chris@kruining.eu"; + # # firstName = "Chris"; + # # lastName = "Kruining"; - project = { - ulmo = { - projectRoleCheck = true; - projectRoleAssertion = true; - hasProjectCheck = true; + # # roles = ["ORG_OWNER"]; + # # instanceRoles = ["IAM_OWNER"]; + # # }; - role = { - jellyfin = { - group = "jellyfin"; - }; - jellyfin_admin = { - group = "jellyfin"; - }; - }; + # # kaas = { + # # email = "chris+kaas@kruining.eu"; + # # firstName = "Kaas"; + # # lastName = "Kruining"; + # # }; + # # }; - assign = { - chris = ["jellyfin" "jellyfin_admin"]; - kaas = ["jellyfin"]; - }; + # # project = { + # # ulmo = { + # # projectRoleCheck = true; + # # projectRoleAssertion = true; + # # hasProjectCheck = true; - application = { - jellyfin = { - redirectUris = ["https://jellyfin.kruining.eu/sso/OID/redirect/zitadel"]; - grantTypes = ["authorizationCode"]; - responseTypes = ["code"]; - }; + # # role = { + # # jellyfin = { + # # group = "jellyfin"; + # # }; + # # jellyfin_admin = { + # # group = "jellyfin"; + # # }; + # # }; - forgejo = { - redirectUris = ["https://git.amarth.cloud/user/oauth2/zitadel/callback"]; - grantTypes = ["authorizationCode"]; - responseTypes = ["code"]; - }; + # # assign = { + # # chris = ["jellyfin" "jellyfin_admin"]; + # # kaas = ["jellyfin"]; + # # }; - vaultwarden = { - redirectUris = ["https://vault.kruining.eu/identity/connect/oidc-signin"]; - grantTypes = ["authorizationCode"]; - responseTypes = ["code"]; - exportMap = { - client_id = "SSO_CLIENT_ID"; - client_secret = "SSO_CLIENT_SECRET"; - }; - }; + # # application = { + # # jellyfin = { + # # redirectUris = ["https://jellyfin.kruining.eu/sso/OID/redirect/zitadel"]; + # # grantTypes = ["authorizationCode"]; + # # responseTypes = ["code"]; + # # }; - matrix = { - redirectUris = ["https://matrix.kruining.eu/_synapse/client/oidc/callback"]; - grantTypes = ["authorizationCode"]; - responseTypes = ["code"]; - }; + # # forgejo = { + # # redirectUris = ["https://git.amarth.cloud/user/oauth2/zitadel/callback"]; + # # grantTypes = ["authorizationCode"]; + # # responseTypes = ["code"]; + # # }; - mydia = { - redirectUris = ["http://localhost:2010/auth/oidc/callback"]; - grantTypes = ["authorizationCode"]; - responseTypes = ["code"]; - }; + # # vaultwarden = { + # # redirectUris = ["https://vault.kruining.eu/identity/connect/oidc-signin"]; + # # grantTypes = ["authorizationCode"]; + # # responseTypes = ["code"]; + # # exportMap = { + # # client_id = "SSO_CLIENT_ID"; + # # client_secret = "SSO_CLIENT_SECRET"; + # # }; + # # }; - grafana = { - redirectUris = ["http://localhost:9001/login/generic_oauth"]; - grantTypes = ["authorizationCode"]; - responseTypes = ["code"]; - }; - }; - }; + # # matrix = { + # # redirectUris = ["https://matrix.kruining.eu/_synapse/client/oidc/callback"]; + # # grantTypes = ["authorizationCode"]; + # # responseTypes = ["code"]; + # # }; - convex = { - projectRoleCheck = true; - projectRoleAssertion = true; - hasProjectCheck = true; + # # mydia = { + # # redirectUris = ["http://localhost:2010/auth/oidc/callback"]; + # # grantTypes = ["authorizationCode"]; + # # responseTypes = ["code"]; + # # }; - application = { - scry = { - redirectUris = ["https://nautical-salamander-320.eu-west-1.convex.cloud/api/auth/callback/zitadel"]; - grantTypes = ["authorizationCode"]; - responseTypes = ["code"]; - }; - }; - }; - }; + # # grafana = { + # # redirectUris = ["http://localhost:9001/login/generic_oauth"]; + # # grantTypes = ["authorizationCode"]; + # # responseTypes = ["code"]; + # # }; + # # }; + # # }; - action = { - flattenRoles = { - script = '' - (ctx, api) => { - if (ctx.v1.user.grants == undefined || ctx.v1.user.grants.count == 0) { - return; - } + # # convex = { + # # projectRoleCheck = true; + # # projectRoleAssertion = true; + # # hasProjectCheck = true; - const roles = ctx.v1.user.grants.grants.flatMap(({ roles, projectId }) => roles.map(role => projectId + ':' + role)); + # # application = { + # # scry = { + # # redirectUris = ["https://nautical-salamander-320.eu-west-1.convex.cloud/api/auth/callback/zitadel"]; + # # grantTypes = ["authorizationCode"]; + # # responseTypes = ["code"]; + # # }; + # # }; + # # }; + # # }; - api.v1.claims.setClaim('nix:zitadel:custom', JSON.stringify({ roles })); - }; - ''; - }; - }; + # # action = { + # # flattenRoles = { + # # script = '' + # # (ctx, api) => { + # # if (ctx.v1.user.grants == undefined || ctx.v1.user.grants.count == 0) { + # # return; + # # } - triggers = [ - { - flowType = "customiseToken"; - triggerType = "preUserinfoCreation"; - actions = ["flattenRoles"]; - } - { - flowType = "customiseToken"; - triggerType = "preAccessTokenCreation"; - actions = ["flattenRoles"]; - } - ]; - }; - }; - }; + # # const roles = ctx.v1.user.grants.grants.flatMap(({ roles, projectId }) => roles.map(role => projectId + ':' + role)); - communication.matrix.enable = true; + # # api.v1.claims.setClaim('nix:zitadel:custom', JSON.stringify({ roles })); + # # }; + # # ''; + # # }; + # # }; - development.forgejo.enable = true; + # # triggers = [ + # # { + # # flowType = "customiseToken"; + # # triggerType = "preUserinfoCreation"; + # # actions = ["flattenRoles"]; + # # } + # # { + # # flowType = "customiseToken"; + # # triggerType = "preAccessTokenCreation"; + # # actions = ["flattenRoles"]; + # # } + # # ]; + # # }; + # # }; + # # }; - networking.ssh.enable = true; - networking.caddy.hosts = { - # Expose amarht cloud stuff like this until I have a proper solution - "auth.amarth.cloud" = '' - reverse_proxy http://192.168.1.223:9092 - ''; + # # communication.matrix.enable = true; - "amarth.cloud" = '' - reverse_proxy http://192.168.1.223:8080 - ''; - }; + # # development.forgejo.enable = true; - media.enable = true; - media.glance.enable = true; - media.mydia.enable = true; - media.nfs.enable = true; - media.jellyfin.enable = true; - media.servarr = { - radarr = { - enable = true; - port = 2001; - rootFolders = [ - "/var/media/movies" - ]; - }; + # # networking.ssh.enable = true; + # # networking.caddy.hosts = { + # # # Expose amarht cloud stuff like this until I have a proper solution + # # "auth.amarth.cloud" = '' + # # reverse_proxy http://192.168.1.223:9092 + # # ''; - sonarr = { - enable = true; - # debug = true; - port = 2002; - rootFolders = [ - "/var/media/series" - ]; - }; + # # "amarth.cloud" = '' + # # reverse_proxy http://192.168.1.223:8080 + # # ''; + # # }; - lidarr = { - enable = true; - debug = true; - port = 2003; - rootFolders = [ - "/var/media/music" - ]; - }; + # # media.enable = true; + # # media.glance.enable = true; + # # media.mydia.enable = true; + # # media.nfs.enable = true; + # # media.jellyfin.enable = true; + # # media.servarr = { + # # radarr = { + # # enable = true; + # # port = 2001; + # # rootFolders = [ + # # "/var/media/movies" + # # ]; + # # }; - prowlarr = { - enable = true; - # debug = true; - port = 2004; - }; - }; + # # sonarr = { + # # enable = true; + # # # debug = true; + # # port = 2002; + # # rootFolders = [ + # # "/var/media/series" + # # ]; + # # }; - observability = { - grafana.enable = true; - prometheus.enable = true; - loki.enable = true; - promtail.enable = true; - # uptime-kuma.enable = true; - }; + # # lidarr = { + # # enable = true; + # # debug = true; + # # port = 2003; + # # rootFolders = [ + # # "/var/media/music" + # # ]; + # # }; - security.vaultwarden = { - enable = true; - database = { - # type = "sqlite"; - # file = "/var/lib/vaultwarden/state.db"; + # # prowlarr = { + # # enable = true; + # # # debug = true; + # # port = 2004; + # # }; + # # }; - type = "postgresql"; - host = "localhost"; - port = 5432; - sslMode = "disabled"; - }; - }; - }; + # # observability = { + # # grafana.enable = true; + # # prometheus.enable = true; + # # loki.enable = true; + # # promtail.enable = true; + # # # uptime-kuma.enable = true; + # # }; - editor = { - nano.enable = true; - }; - }; + # # security.vaultwarden = { + # # enable = true; + # # database = { + # # # type = "sqlite"; + # # # file = "/var/lib/vaultwarden/state.db"; - system.stateVersion = "23.11"; -} \ No newline at end of file + # # type = "postgresql"; + # # host = "localhost"; + # # port = 5432; + # # sslMode = "disabled"; + # # }; + # # }; + # # }; + + # # editor = { + # # nano.enable = true; + # # }; + # # }; +} diff --git a/modules/home/application/bitwarden/default.nix b/modules/home/application/bitwarden/default.nix index f2cd869..5d62919 100644 --- a/modules/home/application/bitwarden/default.nix +++ b/modules/home/application/bitwarden/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.application.bitwarden; + cfg = config.sneeuwvlok.application.bitwarden; in { - options.${namespace}.application.bitwarden = { + options.sneeuwvlok.application.bitwarden = { enable = mkEnableOption "enable bitwarden"; }; diff --git a/modules/home/application/chrome/default.nix b/modules/home/application/chrome/default.nix index ac9f5ef..1848836 100644 --- a/modules/home/application/chrome/default.nix +++ b/modules/home/application/chrome/default.nix @@ -1,11 +1,16 @@ -{ inputs, config, lib, pkgs, namespace, ... }: -let +{ + inputs, + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.application.chrome; -in -{ - options.${namespace}.application.chrome = { + cfg = config.sneeuwvlok.application.chrome; +in { + options.sneeuwvlok.application.chrome = { enable = mkEnableOption "enable chrome"; }; diff --git a/modules/home/application/discord/default.nix b/modules/home/application/discord/default.nix index a736b37..edb640a 100644 --- a/modules/home/application/discord/default.nix +++ b/modules/home/application/discord/default.nix @@ -1,15 +1,20 @@ -{ inputs, config, lib, pkgs, namespace, ... }: -let +{ + inputs, + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.application.discord; -in -{ - options.${namespace}.application.discord = { + cfg = config.sneeuwvlok.application.discord; +in { + options.sneeuwvlok.application.discord = { enable = mkEnableOption "enable discord (vesktop)"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ vesktop ]; + home.packages = with pkgs; [vesktop]; }; } diff --git a/modules/home/application/ladybird/default.nix b/modules/home/application/ladybird/default.nix index 31d7c17..f1ad1ea 100644 --- a/modules/home/application/ladybird/default.nix +++ b/modules/home/application/ladybird/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.application.ladybird; + cfg = config.sneeuwvlok.application.ladybird; in { - options.${namespace}.application.ladybird = { + options.sneeuwvlok.application.ladybird = { enable = mkEnableOption "enable ladybird"; }; diff --git a/modules/home/application/matrix/default.nix b/modules/home/application/matrix/default.nix index 867a94f..d09ea11 100644 --- a/modules/home/application/matrix/default.nix +++ b/modules/home/application/matrix/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.application.matrix; + cfg = config.sneeuwvlok.application.matrix; in { - options.${namespace}.application.matrix = { + options.sneeuwvlok.application.matrix = { enable = mkEnableOption "enable Matrix client (Fractal)"; }; diff --git a/modules/home/application/obs/default.nix b/modules/home/application/obs/default.nix index a2be203..e6ee4e3 100644 --- a/modules/home/application/obs/default.nix +++ b/modules/home/application/obs/default.nix @@ -1,11 +1,16 @@ -{ config, lib, pkgs, namespace, osConfig ? {}, ... }: -let +{ + config, + lib, + pkgs, + namespace, + osConfig ? {}, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.application.obs; -in -{ - options.${namespace}.application.obs = { + cfg = config.sneeuwvlok.application.obs; +in { + options.sneeuwvlok.application.obs = { enable = mkEnableOption "enable obs"; }; diff --git a/modules/home/application/onlyoffice/default.nix b/modules/home/application/onlyoffice/default.nix index 0479539..02484ca 100644 --- a/modules/home/application/onlyoffice/default.nix +++ b/modules/home/application/onlyoffice/default.nix @@ -8,9 +8,9 @@ }: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.application.onlyoffice; + cfg = config.sneeuwvlok.application.onlyoffice; in { - options.${namespace}.application.onlyoffice = { + options.sneeuwvlok.application.onlyoffice = { enable = mkEnableOption "enable onlyoffice"; }; diff --git a/modules/home/application/signal/default.nix b/modules/home/application/signal/default.nix index f4eb1d0..1c591bf 100644 --- a/modules/home/application/signal/default.nix +++ b/modules/home/application/signal/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.application.signal; + cfg = config.sneeuwvlok.application.signal; in { - options.${namespace}.application.signal = { + options.sneeuwvlok.application.signal = { enable = mkEnableOption "enable signal"; }; diff --git a/modules/home/application/steam/default.nix b/modules/home/application/steam/default.nix index 8c87b40..28a8e93 100644 --- a/modules/home/application/steam/default.nix +++ b/modules/home/application/steam/default.nix @@ -1,16 +1,21 @@ -{ inputs, config, lib, pkgs, namespace, ... }: -let +{ + inputs, + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.application.steam; -in -{ - options.${namespace}.application.steam = { + cfg = config.sneeuwvlok.application.steam; +in { + options.sneeuwvlok.application.steam = { enable = mkEnableOption "enable steam"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ protonup-ng ]; + home.packages = with pkgs; [protonup-ng]; home.sessionVariables = { STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d"; diff --git a/modules/home/application/studio/default.nix b/modules/home/application/studio/default.nix index bd4e64e..c883eac 100644 --- a/modules/home/application/studio/default.nix +++ b/modules/home/application/studio/default.nix @@ -2,13 +2,13 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.application.studio; + cfg = config.sneeuwvlok.application.studio; studioPackage = pkgs.callPackage (repoRoot + "/packages/studio/package.nix") { inherit erosanixLib; }; in { - options.${namespace}.application.studio = { + options.sneeuwvlok.application.studio = { enable = mkEnableOption "enable Bricklink Studio"; }; diff --git a/modules/home/application/teamspeak/default.nix b/modules/home/application/teamspeak/default.nix index 3e5e530..031de79 100644 --- a/modules/home/application/teamspeak/default.nix +++ b/modules/home/application/teamspeak/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.application.teamspeak; + cfg = config.sneeuwvlok.application.teamspeak; in { - options.${namespace}.application.teamspeak = { + options.sneeuwvlok.application.teamspeak = { enable = mkEnableOption "enable teamspeak"; }; diff --git a/modules/home/application/thunderbird/default.nix b/modules/home/application/thunderbird/default.nix index 92c8e37..3392358 100644 --- a/modules/home/application/thunderbird/default.nix +++ b/modules/home/application/thunderbird/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.application.thunderbird; + cfg = config.sneeuwvlok.application.thunderbird; in { - options.${namespace}.application.thunderbird = { + options.sneeuwvlok.application.thunderbird = { enable = mkEnableOption "enable thunderbird"; }; diff --git a/modules/home/application/zen/default.nix b/modules/home/application/zen/default.nix index 1d18a92..b8a2505 100644 --- a/modules/home/application/zen/default.nix +++ b/modules/home/application/zen/default.nix @@ -1,11 +1,15 @@ -{ config, lib, pkgs, namespace, ... }: -let +{ + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.application.zen; -in -{ - options.${namespace}.application.zen = { + cfg = config.sneeuwvlok.application.zen; +in { + options.sneeuwvlok.application.zen = { enable = mkEnableOption "enable zen"; }; @@ -50,8 +54,7 @@ in install_url = "https://addons.mozilla.org/firefox/downloads/latest/${builtins.toString id}/latest.xpi"; installation_mode = "force_installed"; }; - in - { + in { ublock_origin = 4531307; ghostry = 4562168; bitwarden = 4562769; diff --git a/modules/home/default.nix b/modules/home/default.nix index 1c9623e..92a65e5 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,9 +1,14 @@ -{ pkgs, config, lib, namespace, ... }: -let +{ + pkgs, + config, + lib, + namespace, + ... +}: let inherit (lib) mkOption; inherit (lib.types) enum; - cfg = config.${namespace}.defaults; + cfg = config.sneeuwvlok.defaults; in { imports = [ ./application @@ -17,30 +22,30 @@ in { ./themes ]; - options.${namespace}.defaults = { + options.sneeuwvlok.defaults = { editor = mkOption { - type = enum [ "nano" "nvim" "zed" ]; + type = enum ["nano" "nvim" "zed"]; default = "nano"; description = "Default editor for text manipulation"; example = "nvim"; }; shell = mkOption { - type = enum [ "fish" "zsh" "bash" ]; + type = enum ["fish" "zsh" "bash"]; default = "zsh"; description = "Default shell"; example = "zsh"; }; terminal = mkOption { - type = enum [ "ghostty" "alacritty" ]; + type = enum ["ghostty" "alacritty"]; default = "ghostty"; description = "Default terminal"; example = "ghostty"; }; browser = mkOption { - type = enum [ "chrome" "ladybird" "zen" ]; + type = enum ["chrome" "ladybird" "zen"]; default = "zen"; description = "Default terminal"; example = "zen"; diff --git a/modules/home/desktop/plasma/default.nix b/modules/home/desktop/plasma/default.nix index 0b679a0..f6e629e 100644 --- a/modules/home/desktop/plasma/default.nix +++ b/modules/home/desktop/plasma/default.nix @@ -2,11 +2,11 @@ let inherit (lib) mkIf; - cfg = config.${namespace}.desktop.plasma; - osCfg = osConfig.${namespace}.desktop.plasma or { enable = false; }; + cfg = config.sneeuwvlok.desktop.plasma; + osCfg = osConfig.sneeuwvlok.desktop.plasma or { enable = false; }; in { - options.${namespace}.desktop.plasma = { + options.sneeuwvlok.desktop.plasma = { }; diff --git a/modules/home/development/dotnet/default.nix b/modules/home/development/dotnet/default.nix index 7ed848e..e1d0f7c 100644 --- a/modules/home/development/dotnet/default.nix +++ b/modules/home/development/dotnet/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.development.dotnet; + cfg = config.sneeuwvlok.development.dotnet; in { - options.${namespace}.development.dotnet = { + options.sneeuwvlok.development.dotnet = { enable = mkEnableOption "Enable dotnet development tools"; }; diff --git a/modules/home/development/javascript/default.nix b/modules/home/development/javascript/default.nix index e649c86..40c94b4 100644 --- a/modules/home/development/javascript/default.nix +++ b/modules/home/development/javascript/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.development.javascript; + cfg = config.sneeuwvlok.development.javascript; in { - options.${namespace}.development.javascript = { + options.sneeuwvlok.development.javascript = { enable = mkEnableOption "Enable javascript development tools"; }; diff --git a/modules/home/development/rust/default.nix b/modules/home/development/rust/default.nix index 4208c68..f545e7e 100644 --- a/modules/home/development/rust/default.nix +++ b/modules/home/development/rust/default.nix @@ -1,15 +1,19 @@ -{ config, lib, pkgs, namespace, ... }: -let +{ + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.development.rust; -in -{ - options.${namespace}.development.rust = { + cfg = config.sneeuwvlok.development.rust; +in { + options.sneeuwvlok.development.rust = { enable = mkEnableOption "Enable rust development tools"; }; - config = mkIf cfg.enable { - - }; + config = + mkIf cfg.enable { + }; } diff --git a/modules/home/editor/nano/default.nix b/modules/home/editor/nano/default.nix index 870db8e..f436775 100644 --- a/modules/home/editor/nano/default.nix +++ b/modules/home/editor/nano/default.nix @@ -1,16 +1,21 @@ -{ config, options, lib, pkgs, namespace, ... }: -let +{ + config, + options, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.editor.nano; -in -{ - options.${namespace}.editor.nano = { + cfg = config.sneeuwvlok.editor.nano; +in { + options.sneeuwvlok.editor.nano = { enable = mkEnableOption "nano"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ nano ]; + home.packages = with pkgs; [nano]; # programs.nano = { # enable = true; diff --git a/modules/home/editor/nvim/default.nix b/modules/home/editor/nvim/default.nix index 162772f..fcb0b25 100644 --- a/modules/home/editor/nvim/default.nix +++ b/modules/home/editor/nvim/default.nix @@ -1,15 +1,20 @@ -{ inputs, config, lib, pkgs, namespace, ... }: -let +{ + inputs, + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.editor.nvim; -in -{ + cfg = config.sneeuwvlok.editor.nvim; +in { # imports = [ # inputs.nvf.nixosModules.default # ]; - options.${namespace}.editor.nvim = { + options.sneeuwvlok.editor.nvim = { enable = mkEnableOption "enable nvim via nvf on user level"; }; diff --git a/modules/home/editor/zed/default.nix b/modules/home/editor/zed/default.nix index f0fe7fa..2da026c 100644 --- a/modules/home/editor/zed/default.nix +++ b/modules/home/editor/zed/default.nix @@ -1,9 +1,9 @@ { config, lib, pkgs, namespace, ... }: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.editor.zed; + cfg = config.sneeuwvlok.editor.zed; in { - options.${namespace}.editor.zed = { + options.sneeuwvlok.editor.zed = { enable = mkEnableOption "zed"; }; diff --git a/modules/home/game/minecraft/default.nix b/modules/home/game/minecraft/default.nix index e5dedc6..fbdcc9d 100644 --- a/modules/home/game/minecraft/default.nix +++ b/modules/home/game/minecraft/default.nix @@ -1,15 +1,20 @@ -{ inputs, config, lib, pkgs, namespace, ... }: -let +{ + inputs, + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.game.minecraft; -in -{ - options.${namespace}.game.minecraft = { + cfg = config.sneeuwvlok.game.minecraft; +in { + options.sneeuwvlok.game.minecraft = { enable = mkEnableOption "enable minecraft"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ prismlauncher ]; + home.packages = with pkgs; [prismlauncher]; }; } diff --git a/modules/home/shell/default.nix b/modules/home/shell/default.nix index 636156a..2081c59 100644 --- a/modules/home/shell/default.nix +++ b/modules/home/shell/default.nix @@ -2,7 +2,7 @@ let inherit (lib) mkIf mkMerge mkEnableOption mkDefault; - cfg = config.${namespace}.shell; + cfg = config.sneeuwvlok.shell; in { imports = [ @@ -10,13 +10,13 @@ in ./zsh ]; - options.${namespace}.shell = { + options.sneeuwvlok.shell = { corePkgs.enable = mkEnableOption "core shell packages"; }; config = mkMerge [ (mkIf (cfg.corePkgs.enable) { - ${namespace}.shell.toolset = mkDefault { + sneeuwvlok.shell.toolset = mkDefault { bat.enable = true; btop.enable = true; eza.enable = true; diff --git a/modules/home/shell/toolset/bat/default.nix b/modules/home/shell/toolset/bat/default.nix index 78899df..0c403ee 100644 --- a/modules/home/shell/toolset/bat/default.nix +++ b/modules/home/shell/toolset/bat/default.nix @@ -1,16 +1,20 @@ -{ config, lib, pkgs, namespace, ... }: -let +{ + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.shell.toolset.bat; -in -{ - options.${namespace}.shell.toolset.bat = { + cfg = config.sneeuwvlok.shell.toolset.bat; +in { + options.sneeuwvlok.shell.toolset.bat = { enable = mkEnableOption "cat replacement"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ bat ]; + home.packages = with pkgs; [bat]; programs.bat = { enable = true; diff --git a/modules/home/shell/toolset/btop/default.nix b/modules/home/shell/toolset/btop/default.nix index b490acc..4368367 100644 --- a/modules/home/shell/toolset/btop/default.nix +++ b/modules/home/shell/toolset/btop/default.nix @@ -1,17 +1,21 @@ -{ config, lib, pkgs, namespace, ... }: -let +{ + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; inherit (lib.strings) concatStringsSep; - cfg = config.${namespace}.shell.toolset.btop; -in -{ - options.${namespace}.shell.toolset.btop = { + cfg = config.sneeuwvlok.shell.toolset.btop; +in { + options.sneeuwvlok.shell.toolset.btop = { enable = mkEnableOption "system-monitor"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ btop ]; + home.packages = with pkgs; [btop]; programs.btop = { enable = true; diff --git a/modules/home/shell/toolset/eza/default.nix b/modules/home/shell/toolset/eza/default.nix index 00026cf..463e9ae 100644 --- a/modules/home/shell/toolset/eza/default.nix +++ b/modules/home/shell/toolset/eza/default.nix @@ -1,16 +1,20 @@ -{ config, lib, pkgs, namespace, ... }: -let +{ + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.shell.toolset.eza; -in -{ - options.${namespace}.shell.toolset.eza = { + cfg = config.sneeuwvlok.shell.toolset.eza; +in { + options.sneeuwvlok.shell.toolset.eza = { enable = mkEnableOption "system-monitor"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ eza ]; + home.packages = with pkgs; [eza]; programs.eza = { enable = true; diff --git a/modules/home/shell/toolset/fzf/default.nix b/modules/home/shell/toolset/fzf/default.nix index e2f0313..7e0706b 100644 --- a/modules/home/shell/toolset/fzf/default.nix +++ b/modules/home/shell/toolset/fzf/default.nix @@ -1,16 +1,20 @@ -{ config, lib, pkgs, namespace, ... }: -let +{ + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.shell.toolset.fzf; -in -{ - options.${namespace}.shell.toolset.fzf = { + cfg = config.sneeuwvlok.shell.toolset.fzf; +in { + options.sneeuwvlok.shell.toolset.fzf = { enable = mkEnableOption "TUI Fuzzy Finder."; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ fzf ]; + home.packages = with pkgs; [fzf]; programs.fzf = { enable = true; diff --git a/modules/home/shell/toolset/git/default.nix b/modules/home/shell/toolset/git/default.nix index dd138c8..9f42376 100644 --- a/modules/home/shell/toolset/git/default.nix +++ b/modules/home/shell/toolset/git/default.nix @@ -7,9 +7,9 @@ }: let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.shell.toolset.git; + cfg = config.sneeuwvlok.shell.toolset.git; in { - options.${namespace}.shell.toolset.git = { + options.sneeuwvlok.shell.toolset.git = { enable = mkEnableOption "version-control system"; }; diff --git a/modules/home/shell/toolset/gnugpg/default.nix b/modules/home/shell/toolset/gnugpg/default.nix index 8b6ae38..8340ba4 100644 --- a/modules/home/shell/toolset/gnugpg/default.nix +++ b/modules/home/shell/toolset/gnugpg/default.nix @@ -1,11 +1,15 @@ -{ config, lib, pkgs, namespace, ... }: -let +{ + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.shell.toolset.gnupg; -in -{ - options.${namespace}.shell.toolset.gnupg = { + cfg = config.sneeuwvlok.shell.toolset.gnupg; +in { + options.sneeuwvlok.shell.toolset.gnupg = { enable = mkEnableOption "cryptographic suite"; }; diff --git a/modules/home/shell/toolset/just/default.nix b/modules/home/shell/toolset/just/default.nix index e956b2a..983b5d6 100644 --- a/modules/home/shell/toolset/just/default.nix +++ b/modules/home/shell/toolset/just/default.nix @@ -1,15 +1,19 @@ -{ config, lib, pkgs, namespace, ... }: -let +{ + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.shell.toolset.just; -in -{ - options.${namespace}.shell.toolset.just = { + cfg = config.sneeuwvlok.shell.toolset.just; +in { + options.sneeuwvlok.shell.toolset.just = { enable = mkEnableOption "version-control system"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ just gum ]; + home.packages = with pkgs; [just gum]; }; } diff --git a/modules/home/shell/toolset/starship/default.nix b/modules/home/shell/toolset/starship/default.nix index 28d57f7..9c52947 100644 --- a/modules/home/shell/toolset/starship/default.nix +++ b/modules/home/shell/toolset/starship/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.shell.toolset.starship; + cfg = config.sneeuwvlok.shell.toolset.starship; in { - options.${namespace}.shell.toolset.starship = { + options.sneeuwvlok.shell.toolset.starship = { enable = mkEnableOption "fancy pansy shell prompt"; }; diff --git a/modules/home/shell/toolset/tmux/default.nix b/modules/home/shell/toolset/tmux/default.nix index ed14ba6..95c54d4 100644 --- a/modules/home/shell/toolset/tmux/default.nix +++ b/modules/home/shell/toolset/tmux/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.shell.toolset.tmux; + cfg = config.sneeuwvlok.shell.toolset.tmux; in { - options.${namespace}.shell.toolset.tmux = { + options.sneeuwvlok.shell.toolset.tmux = { enable = mkEnableOption "terminal multiplexer"; }; diff --git a/modules/home/shell/toolset/yazi/default.nix b/modules/home/shell/toolset/yazi/default.nix index 37138a0..4c5f2f5 100644 --- a/modules/home/shell/toolset/yazi/default.nix +++ b/modules/home/shell/toolset/yazi/default.nix @@ -1,16 +1,20 @@ -{ config, lib, pkgs, namespace, ... }: -let +{ + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.shell.toolset.yazi; -in -{ - options.${namespace}.shell.toolset.yazi = { + cfg = config.sneeuwvlok.shell.toolset.yazi; +in { + options.sneeuwvlok.shell.toolset.yazi = { enable = mkEnableOption "cli file browser"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ yazi ]; + home.packages = with pkgs; [yazi]; programs.yazi = { enable = true; diff --git a/modules/home/shell/toolset/zellij/default.nix b/modules/home/shell/toolset/zellij/default.nix index db5b7bd..fb366e1 100644 --- a/modules/home/shell/toolset/zellij/default.nix +++ b/modules/home/shell/toolset/zellij/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.shell.toolset.zellij; + cfg = config.sneeuwvlok.shell.toolset.zellij; in { - options.${namespace}.shell.toolset.zellij = { + options.sneeuwvlok.shell.toolset.zellij = { enable = mkEnableOption "terminal multiplexer"; }; diff --git a/modules/home/shell/toolset/zoxide/default.nix b/modules/home/shell/toolset/zoxide/default.nix index 5b8acb6..53a1f35 100644 --- a/modules/home/shell/toolset/zoxide/default.nix +++ b/modules/home/shell/toolset/zoxide/default.nix @@ -1,16 +1,20 @@ -{ config, lib, pkgs, namespace, ... }: -let +{ + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.shell.toolset.zoxide; -in -{ - options.${namespace}.shell.toolset.zoxide = { + cfg = config.sneeuwvlok.shell.toolset.zoxide; +in { + options.sneeuwvlok.shell.toolset.zoxide = { enable = mkEnableOption "cd replacement"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ zoxide ]; + home.packages = with pkgs; [zoxide]; programs.zoxide = { enable = true; diff --git a/modules/home/shell/zsh/default.nix b/modules/home/shell/zsh/default.nix index b37cc4c..02dc043 100644 --- a/modules/home/shell/zsh/default.nix +++ b/modules/home/shell/zsh/default.nix @@ -2,15 +2,15 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.shell.zsh; + cfg = config.sneeuwvlok.shell.zsh; in { - options.${namespace}.shell.zsh = { + options.sneeuwvlok.shell.zsh = { enable = mkEnableOption "enable ZSH"; }; config = mkIf cfg.enable { - # ${namespace}.shell = { + # sneeuwvlok.shell = { # zsh.enable = true; # }; diff --git a/modules/home/terminal/alacritty/default.nix b/modules/home/terminal/alacritty/default.nix index b6e5822..73468f6 100644 --- a/modules/home/terminal/alacritty/default.nix +++ b/modules/home/terminal/alacritty/default.nix @@ -1,11 +1,14 @@ -{ config, lib, namespace, ... }: -let +{ + config, + lib, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.terminal.alacritty; -in -{ - options.${namespace}.terminal.alacritty = { + cfg = config.sneeuwvlok.terminal.alacritty; +in { + options.sneeuwvlok.terminal.alacritty = { enable = mkEnableOption "enable alacritty"; }; diff --git a/modules/home/terminal/ghostty/default.nix b/modules/home/terminal/ghostty/default.nix index 4681b53..6949df1 100644 --- a/modules/home/terminal/ghostty/default.nix +++ b/modules/home/terminal/ghostty/default.nix @@ -1,11 +1,14 @@ -{ config, lib, namespace, ... }: -let +{ + config, + lib, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.terminal.ghostty; -in -{ - options.${namespace}.terminal.ghostty = { + cfg = config.sneeuwvlok.terminal.ghostty; +in { + options.sneeuwvlok.terminal.ghostty = { enable = mkEnableOption "enable ghostty"; }; @@ -13,10 +16,10 @@ in programs.ghostty = { enable = true; settings = { - command = config.${namespace}.defaults.shell; + command = config.sneeuwvlok.defaults.shell; background-blur-radius = 20; theme = "dark:stylix,light:stylix"; - window-theme = (config.${namespace}.themes.polarity or "dark"); + window-theme = config.sneeuwvlok.themes.polarity or "dark"; background-opacity = 0.8; minimum-contrast = 1.1; }; diff --git a/modules/home/themes/default.nix b/modules/home/themes/default.nix index d338b88..d6f8b6a 100644 --- a/modules/home/themes/default.nix +++ b/modules/home/themes/default.nix @@ -1,24 +1,30 @@ -{ config, lib, pkgs, namespace, osConfig ? {}, ... }: -let +{ + config, + lib, + pkgs, + namespace, + osConfig ? {}, + ... +}: let inherit (lib) mkIf mkDefault; inherit (lib.options) mkOption mkEnableOption; inherit (lib.types) nullOr enum; - cfg = config.${namespace}.themes; - osCfg = osConfig.${namespace}.theming; + cfg = config.sneeuwvlok.themes; + osCfg = osConfig.sneeuwvlok.theming; in { - options.${namespace}.themes = { + options.sneeuwvlok.themes = { enable = mkEnableOption "Theming (Stylix)"; theme = mkOption { - type = nullOr (enum [ "everforest" "catppuccin-latte" "chalk" ]); + type = nullOr (enum ["everforest" "catppuccin-latte" "chalk"]); default = "everforest"; description = "The theme to set the system to"; example = "everforest"; }; polarity = mkOption { - type = nullOr (enum [ "dark" "light" ]); + type = nullOr (enum ["dark" "light"]); default = "dark"; description = "determine if system is in dark or light mode"; }; @@ -33,7 +39,7 @@ in { polarity = cfg.polarity; targets.qt.platform = mkDefault "kde"; - targets.zen-browser.profileNames = [ "Chris" ]; + targets.zen-browser.profileNames = ["Chris"]; fonts = { serif = { diff --git a/modules/nixos/application/default.nix b/modules/nixos/application/default.nix deleted file mode 100644 index cd39af6..0000000 --- a/modules/nixos/application/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = [ - ./steam - ]; -} diff --git a/modules/nixos/application/steam.nix b/modules/nixos/application/steam.nix new file mode 100644 index 0000000..de83987 --- /dev/null +++ b/modules/nixos/application/steam.nix @@ -0,0 +1,29 @@ +{ + lib, + pkgs, + config, + ... +}: let + inherit (lib) mkIf mkEnableOption; + + cfg = config.sneeuwvlok.application.steam; +in { + options.sneeuwvlok.application.steam = { + enable = mkEnableOption "enable steam"; + }; + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [steam]; + + programs = { + steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + extraCompatPackages = with pkgs; [ + proton-ge-bin + ]; + }; + }; + }; +} diff --git a/modules/nixos/application/steam/default.nix b/modules/nixos/application/steam/default.nix deleted file mode 100644 index 061765e..0000000 --- a/modules/nixos/application/steam/default.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ - inputs, - config, - lib, - pkgs, - namespace, - ... -}: let - inherit (lib) mkIf mkEnableOption; - - cfg = config.${namespace}.application.steam; -in { - options.${namespace}.application.steam = { - enable = mkEnableOption "enable steam"; - }; - - config = mkIf cfg.enable { - # environment.systemPackages = with pkgs; [ steam ]; - - programs = { - steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - - extraCompatPackages = with pkgs; [ - proton-ge-bin - ]; - - # package = pkgs.steam.override { - # extraEnv = { - # DXVK_HUD = "compiler"; - # MANGOHUD = true; - # }; - # }; - - # gamescopeSession = { - # enable = true; - # args = ["--immediate-flips"]; - # }; - }; - - # https://github.com/FeralInteractive/gamemode - # gamemode = { - # enable = true; - # enableRenice = true; - # settings = {}; - # }; - - # gamescope = { - # enable = true; - # capSysNice = true; - # env = { - # DXVK_HDR = "1"; - # ENABLE_GAMESCOPE_WSI = "1"; - # WINE_FULLSCREEN_FSR = "1"; - # WLR_RENDERER = "vulkan"; - # }; - # args = ["--hdr-enabled"]; - # }; - }; - }; -} diff --git a/modules/nixos/boot/default.nix b/modules/nixos/boot/default.nix index 1f844d1..87df4d9 100644 --- a/modules/nixos/boot/default.nix +++ b/modules/nixos/boot/default.nix @@ -1,14 +1,18 @@ -{ lib, namespace, config, pkgs, ... }: -let +{ + lib, + namespace, + config, + pkgs, + ... +}: let inherit (lib) mkIf mkMerge mkDefault mkOption; inherit (lib.types) enum bool; - cfg = config.${namespace}.boot; -in -{ - options.${namespace}.boot = { + cfg = config.sneeuwvlok.boot; +in { + options.sneeuwvlok.boot = { type = mkOption { - type = enum [ "bios" "uefi" ]; + type = enum ["bios" "uefi"]; default = "uefi"; }; @@ -24,7 +28,7 @@ in }; config = mkMerge [ - ({ + { boot = { kernelPackages = pkgs.linuxPackages_latest; @@ -39,9 +43,9 @@ in }; }; - supportedFilesystems = [ "nfs" ]; + supportedFilesystems = ["nfs"]; }; - }) + } (mkIf (cfg.type == "bios") { boot.loader.grub.efiSupport = false; @@ -87,7 +91,7 @@ in theme = mkDefault "pixels"; themePackages = with pkgs; [ (adi1090x-plymouth-themes.override { - selected_themes = [ "pixels" ]; + selected_themes = ["pixels"]; }) ]; }; diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 1a2c686..9ebbe7b 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -1,14 +1,15 @@ { imports = [ - ./application - ./boot - ./desktop - ./editor - ./hardware - ./home-manager - ./nix + ./application/steam.nix + ./boot/default.nix + ./editor/nano/default.nix + ./editor/nvim/default.nix + ./hardware/audio/default.nix + ./home-manager/default.nix ./services - ./shells - ./system + ./system/networking + ./system/security/boot + ./system/security/sops + ./system/security/sudo ]; } diff --git a/modules/nixos/desktop/cosmic/default.nix b/modules/nixos/desktop/cosmic/default.nix index cba6955..c4531ba 100644 --- a/modules/nixos/desktop/cosmic/default.nix +++ b/modules/nixos/desktop/cosmic/default.nix @@ -7,13 +7,13 @@ }: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.desktop.cosmic; + cfg = config.sneeuwvlok.desktop.cosmic; in { - options.${namespace}.desktop.cosmic = { + options.sneeuwvlok.desktop.cosmic = { enable = mkEnableOption "Enable Cosmic desktop" // { - default = config.${namespace}.desktop.use == "cosmic"; + default = config.sneeuwvlok.desktop.use == "cosmic"; }; }; diff --git a/modules/nixos/desktop/default.nix b/modules/nixos/desktop/default.nix index 03d36e6..d231d9a 100644 --- a/modules/nixos/desktop/default.nix +++ b/modules/nixos/desktop/default.nix @@ -7,7 +7,7 @@ inherit (lib) mkIf mkOption mkEnableOption mkMerge; inherit (lib.types) nullOr enum; - cfg = config.${namespace}.desktop; + cfg = config.sneeuwvlok.desktop; in { imports = [ ./cosmic @@ -16,7 +16,7 @@ in { ./plasma ]; - options.${namespace}.desktop = { + options.sneeuwvlok.desktop = { use = mkOption { type = nullOr (enum ["plasma" "gamescope" "gnome" "cosmic"]); default = null; @@ -33,7 +33,7 @@ in { } # (mkIf (cfg.use != null) { - # ${namespace}.desktop.${cfg.use}.enable = true; + # sneeuwvlok.desktop.${cfg.use}.enable = true; # }) ]; } diff --git a/modules/nixos/desktop/gamescope/default.nix b/modules/nixos/desktop/gamescope/default.nix index 9e499be..500a3fa 100644 --- a/modules/nixos/desktop/gamescope/default.nix +++ b/modules/nixos/desktop/gamescope/default.nix @@ -1,18 +1,23 @@ -{ lib, config, namespace, ... }: -let +{ + lib, + config, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption mkForce; - cfg = config.${namespace}.desktop.gamescope; -in -{ - options.${namespace}.desktop.gamescope = { - enable = mkEnableOption "Enable Steamdeck ui" // { - default = (config.${namespace}.desktop.use == "gamescope"); - }; + cfg = config.sneeuwvlok.desktop.gamescope; +in { + options.sneeuwvlok.desktop.gamescope = { + enable = + mkEnableOption "Enable Steamdeck ui" + // { + default = config.sneeuwvlok.desktop.use == "gamescope"; + }; }; config = mkIf cfg.enable { - ${namespace}.desktop.plasma.enable = true; + sneeuwvlok.desktop.plasma.enable = true; services.displayManager.sddm.enable = mkForce false; services.displayManager.gdm.enable = mkForce false; diff --git a/modules/nixos/desktop/gnome/default.nix b/modules/nixos/desktop/gnome/default.nix index 979587f..ad1eac4 100644 --- a/modules/nixos/desktop/gnome/default.nix +++ b/modules/nixos/desktop/gnome/default.nix @@ -1,16 +1,22 @@ -{ lib, config, namespace, ... }: -let +{ + lib, + config, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.desktop.gnome; -in -{ - options.${namespace}.desktop.gnome = { - enable = mkEnableOption "Enable Gnome" // { - default = (config.${namespace}.desktop.use == "gnome"); - }; + cfg = config.sneeuwvlok.desktop.gnome; +in { + options.sneeuwvlok.desktop.gnome = { + enable = + mkEnableOption "Enable Gnome" + // { + default = config.sneeuwvlok.desktop.use == "gnome"; + }; }; - config = mkIf cfg.enable { - }; + config = + mkIf cfg.enable { + }; } diff --git a/modules/nixos/desktop/plasma/default.nix b/modules/nixos/desktop/plasma/default.nix index aa1e497..0c0ea58 100644 --- a/modules/nixos/desktop/plasma/default.nix +++ b/modules/nixos/desktop/plasma/default.nix @@ -1,14 +1,20 @@ -{ pkgs, lib, config, namespace, ... }: -let +{ + pkgs, + lib, + config, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.desktop.plasma; -in -{ - options.${namespace}.desktop.plasma = { - enable = mkEnableOption "Enable KDE Plasma" // { - default = (config.${namespace}.desktop.use == "plasma"); - }; + cfg = config.sneeuwvlok.desktop.plasma; +in { + options.sneeuwvlok.desktop.plasma = { + enable = + mkEnableOption "Enable KDE Plasma" + // { + default = config.sneeuwvlok.desktop.use == "plasma"; + }; }; config = mkIf cfg.enable { diff --git a/modules/nixos/editor/nano/default.nix b/modules/nixos/editor/nano/default.nix index 1cb7ff1..6d89c72 100644 --- a/modules/nixos/editor/nano/default.nix +++ b/modules/nixos/editor/nano/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.editor.nano; + cfg = config.sneeuwvlok.editor.nano; in { - options.${namespace}.editor.nano = { + options.sneeuwvlok.editor.nano = { enable = mkEnableOption "nano"; }; diff --git a/modules/nixos/editor/nvim/default.nix b/modules/nixos/editor/nvim/default.nix index fb3bc56..624c7c1 100644 --- a/modules/nixos/editor/nvim/default.nix +++ b/modules/nixos/editor/nvim/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.editor.nvim; + cfg = config.sneeuwvlok.editor.nvim; in { - options.${namespace}.editor.nvim = { + options.sneeuwvlok.editor.nvim = { enable = mkEnableOption "enable nvim via nvf on system level"; }; diff --git a/modules/nixos/hardware/audio/default.nix b/modules/nixos/hardware/audio/default.nix index d3f340f..ca01562 100644 --- a/modules/nixos/hardware/audio/default.nix +++ b/modules/nixos/hardware/audio/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.hardware.has.audio; + cfg = config.sneeuwvlok.hardware.has.audio; in { - options.${namespace}.hardware.has.audio = mkEnableOption "Enable bluetooth"; + options.sneeuwvlok.hardware.has.audio = mkEnableOption "Enable bluetooth"; config = mkIf cfg { environment.systemPackages = with pkgs; [ diff --git a/modules/nixos/hardware/bluetooth/default.nix b/modules/nixos/hardware/bluetooth/default.nix index 98fc678..8fbf999 100644 --- a/modules/nixos/hardware/bluetooth/default.nix +++ b/modules/nixos/hardware/bluetooth/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.hardware.has.bluetooth; + cfg = config.sneeuwvlok.hardware.has.bluetooth; in { - options.${namespace}.hardware.has.bluetooth = mkEnableOption "Enable bluetooth"; + options.sneeuwvlok.hardware.has.bluetooth = mkEnableOption "Enable bluetooth"; config = mkIf cfg { hardware.bluetooth = { diff --git a/modules/nixos/hardware/gpu/amd/default.nix b/modules/nixos/hardware/gpu/amd/default.nix index cdc9d1e..e1da9e8 100644 --- a/modules/nixos/hardware/gpu/amd/default.nix +++ b/modules/nixos/hardware/gpu/amd/default.nix @@ -1,14 +1,18 @@ -{ pkgs, lib, namespace, config, ... }: -let +{ + pkgs, + lib, + namespace, + config, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.hardware.has.gpu; -in -{ - options.${namespace}.hardware.has.gpu.amd = mkEnableOption "Enable AMD gpu configuration"; + cfg = config.sneeuwvlok.hardware.has.gpu; +in { + options.sneeuwvlok.hardware.has.gpu.amd = mkEnableOption "Enable AMD gpu configuration"; config = mkIf cfg.amd { - services.xserver.videoDrivers = [ "amd" ]; + services.xserver.videoDrivers = ["amd"]; hardware = { graphics = { diff --git a/modules/nixos/hardware/gpu/nvidia.nix b/modules/nixos/hardware/gpu/nvidia.nix index e8ac542..b0296ca 100644 --- a/modules/nixos/hardware/gpu/nvidia.nix +++ b/modules/nixos/hardware/gpu/nvidia.nix @@ -2,10 +2,10 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.hardware.has.gpu.nvidia; + cfg = config.sneeuwvlok.hardware.has.gpu.nvidia; in { - options.${namespace}.hardware.has.gpu.nvidia = mkEnableOption "Enable NVidia gpu configuration"; + options.sneeuwvlok.hardware.has.gpu.nvidia = mkEnableOption "Enable NVidia gpu configuration"; config = mkIf cfg { services.xserver.videoDrivers = [ "nvidia" ]; diff --git a/modules/nixos/hardware/gpu/nvidia/default.nix b/modules/nixos/hardware/gpu/nvidia/default.nix index ab7c087..48c5a54 100644 --- a/modules/nixos/hardware/gpu/nvidia/default.nix +++ b/modules/nixos/hardware/gpu/nvidia/default.nix @@ -1,14 +1,18 @@ -{ pkgs, lib, namespace, config, ... }: -let +{ + pkgs, + lib, + namespace, + config, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.hardware.has.gpu; -in -{ - options.${namespace}.hardware.has.gpu.nvidia = mkEnableOption "Enable NVidia gpu configuration"; + cfg = config.sneeuwvlok.hardware.has.gpu; +in { + options.sneeuwvlok.hardware.has.gpu.nvidia = mkEnableOption "Enable NVidia gpu configuration"; config = mkIf cfg.nvidia { - services.xserver.videoDrivers = [ "nvidia" ]; + services.xserver.videoDrivers = ["nvidia"]; hardware = { graphics = { diff --git a/modules/nixos/hardware/keyboard/voyager.nix b/modules/nixos/hardware/keyboard/voyager.nix index fd470f8..e97b7da 100644 --- a/modules/nixos/hardware/keyboard/voyager.nix +++ b/modules/nixos/hardware/keyboard/voyager.nix @@ -1,11 +1,15 @@ -{ lib, config, pkgs, namespace, ... }: -let +{ + lib, + config, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.hardware.keyboard.voyager; -in -{ - options.${namespace}.hardware.keyboard.voyager = { + cfg = config.sneeuwvlok.hardware.keyboard.voyager; +in { + options.sneeuwvlok.hardware.keyboard.voyager = { enble = mkEnableOption "Enable tools for ZSA Voyager"; }; diff --git a/modules/nixos/nix/default.nix b/modules/nixos/nix/default.nix index bf96f59..24db3dc 100644 --- a/modules/nixos/nix/default.nix +++ b/modules/nixos/nix/default.nix @@ -1,9 +1,13 @@ -{ pkgs, lib, namespace, config, ... }: -let - cfg = config.${namespace}.nix; -in { - options.${namespace}.nix = {}; + pkgs, + lib, + namespace, + config, + ... +}: let + cfg = config.sneeuwvlok.nix; +in { + options.sneeuwvlok.nix = {}; config = { programs.git.enable = true; @@ -14,9 +18,9 @@ in extraOptions = "experimental-features = nix-command flakes pipe-operators"; settings = { - experimental-features = [ "nix-command" "flakes" "pipe-operators" ]; - allowed-users = [ "@wheel" ]; - trusted-users = [ "@wheel" ]; + experimental-features = ["nix-command" "flakes" "pipe-operators"]; + allowed-users = ["@wheel"]; + trusted-users = ["@wheel"]; auto-optimise-store = true; connect-timeout = 5; diff --git a/modules/nixos/services/authentication/authelia/default.nix b/modules/nixos/services/authentication/authelia/default.nix index 7aea103..8121ad8 100644 --- a/modules/nixos/services/authentication/authelia/default.nix +++ b/modules/nixos/services/authentication/authelia/default.nix @@ -8,14 +8,14 @@ inherit (lib) mkIf mkEnableOption; user = "authelia-testing"; - cfg = config.${namespace}.services.authentication.authelia; + cfg = config.sneeuwvlok.services.authentication.authelia; in { - options.${namespace}.services.authentication.authelia = { + options.sneeuwvlok.services.authentication.authelia = { enable = mkEnableOption "Authelia"; }; config = mkIf cfg.enable { - ${namespace}.services.networking.caddy = { + sneeuwvlok.services.networking.caddy = { hosts = { "auth.kruining.eu".extraConfig = '' reverse_proxy http://127.0.0.1:9091 diff --git a/modules/nixos/services/authentication/himmelblau/default.nix b/modules/nixos/services/authentication/himmelblau/default.nix index 228fea0..f30a079 100644 --- a/modules/nixos/services/authentication/himmelblau/default.nix +++ b/modules/nixos/services/authentication/himmelblau/default.nix @@ -6,9 +6,9 @@ }: let inherit (lib) mkEnableOption mkIf; - cfg = config.${namespace}.services.authentication.himmelblau; + cfg = config.sneeuwvlok.services.authentication.himmelblau; in { - options.${namespace}.services.authentication.himmelblau = { + options.sneeuwvlok.services.authentication.himmelblau = { enable = mkEnableOption "enable azure entra ID authentication"; }; diff --git a/modules/nixos/services/authentication/zitadel/default.nix b/modules/nixos/services/authentication/zitadel/default.nix index ff95e79..8168a5a 100644 --- a/modules/nixos/services/authentication/zitadel/default.nix +++ b/modules/nixos/services/authentication/zitadel/default.nix @@ -3,12 +3,12 @@ let inherit (lib) mkIf mkEnableOption mkOption types toUpper toSentenceCase nameValuePair mapAttrs mapAttrs' concatMapAttrs concatMapStringsSep filterAttrsRecursive listToAttrs imap0 head drop length literalExpression attrNames; inherit (sneeuwvlokLib.strings) toSnakeCase; - cfg = config.${namespace}.services.authentication.zitadel; + cfg = config.sneeuwvlok.services.authentication.zitadel; database = "zitadel"; in { - options.${namespace}.services.authentication.zitadel = { + options.sneeuwvlok.services.authentication.zitadel = { enable = mkEnableOption "Zitadel"; organization = mkOption { @@ -537,7 +537,7 @@ in }; in mkIf cfg.enable { - ${namespace}.services = { + sneeuwvlok.services = { persistance.postgresql.enable = true; networking.caddy = { diff --git a/modules/nixos/services/backup/borg/default.nix b/modules/nixos/services/backup/borg/default.nix index 9cbbea0..f892bca 100644 --- a/modules/nixos/services/backup/borg/default.nix +++ b/modules/nixos/services/backup/borg/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.services.backup.borg; + cfg = config.sneeuwvlok.services.backup.borg; in { - options.${namespace}.services.backup.borg = { + options.sneeuwvlok.services.backup.borg = { enable = mkEnableOption "Borg Backup"; }; diff --git a/modules/nixos/services/communication/matrix/default.nix b/modules/nixos/services/communication/matrix/default.nix index d2e47b0..210835f 100644 --- a/modules/nixos/services/communication/matrix/default.nix +++ b/modules/nixos/services/communication/matrix/default.nix @@ -8,7 +8,7 @@ inherit (builtins) toString toJSON; inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.services.communication.matrix; + cfg = config.sneeuwvlok.services.communication.matrix; domain = "kruining.eu"; fqn = "matrix.${domain}"; @@ -17,12 +17,12 @@ database = "synapse"; keyFile = "/var/lib/element-call/key"; in { - options.${namespace}.services.communication.matrix = { + options.sneeuwvlok.services.communication.matrix = { enable = mkEnableOption "Matrix server (Synapse)"; }; config = mkIf cfg.enable { - ${namespace}.services = { + sneeuwvlok.services = { persistance.postgresql.enable = true; # virtualisation.podman.enable = true; diff --git a/modules/nixos/services/development/forgejo/default.nix b/modules/nixos/services/development/forgejo/default.nix index f190b0c..ae5379b 100644 --- a/modules/nixos/services/development/forgejo/default.nix +++ b/modules/nixos/services/development/forgejo/default.nix @@ -8,10 +8,10 @@ inherit (builtins) toString; inherit (lib) mkIf mkEnableOption mkOption; - cfg = config.${namespace}.services.development.forgejo; + cfg = config.sneeuwvlok.services.development.forgejo; domain = "git.amarth.cloud"; in { - options.${namespace}.services.development.forgejo = { + options.sneeuwvlok.services.development.forgejo = { enable = mkEnableOption "Forgejo"; port = mkOption { @@ -25,7 +25,7 @@ in { }; config = mkIf cfg.enable { - ${namespace}.services = { + sneeuwvlok.services = { persistance.postgresql.enable = true; virtualisation.podman.enable = true; diff --git a/modules/nixos/services/games/minecraft/default.nix b/modules/nixos/services/games/minecraft/default.nix index 851d1da..4488833 100644 --- a/modules/nixos/services/games/minecraft/default.nix +++ b/modules/nixos/services/games/minecraft/default.nix @@ -8,9 +8,9 @@ inherit (lib) mkIf mkEnableOption mkOption; inherit (lib.types) str; - cfg = config.${namespace}.services.games.minecraft; + cfg = config.sneeuwvlok.services.games.minecraft; in { - options.${namespace}.services.games.minecraft = { + options.sneeuwvlok.services.games.minecraft = { enable = mkEnableOption "Minecraft"; user = mkOption { diff --git a/modules/nixos/services/games/openrct.nix b/modules/nixos/services/games/openrct.nix index a36f0fb..0090ffa 100644 --- a/modules/nixos/services/games/openrct.nix +++ b/modules/nixos/services/games/openrct.nix @@ -1,11 +1,15 @@ -{ config, lib, pkgs, namespace, ... }: -let +{ + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.services.games.openrct; -in -{ - options.${namespace}.services.games.openrct = { + cfg = config.sneeuwvlok.services.games.openrct; +in { + options.sneeuwvlok.services.games.openrct = { enable = mkEnableOption "OpenRCT2"; }; @@ -16,7 +20,7 @@ in systemd.services.openrct = { enable = true; - after = [ "network.target"]; + after = ["network.target"]; description = "OpenRCT2 Server"; serviceConfig = { Type = ""; diff --git a/modules/nixos/services/games/palworld/default.nix b/modules/nixos/services/games/palworld/default.nix index 152891d..e1414a4 100644 --- a/modules/nixos/services/games/palworld/default.nix +++ b/modules/nixos/services/games/palworld/default.nix @@ -6,9 +6,9 @@ }: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.services.games.palworld; + cfg = config.sneeuwvlok.services.games.palworld; in { - options.${namespace}.services.games.palworld = { + options.sneeuwvlok.services.games.palworld = { enable = mkEnableOption "Palworld"; }; diff --git a/modules/nixos/services/media/default.nix b/modules/nixos/services/media/default.nix index 7a0d102..d2395ef 100644 --- a/modules/nixos/services/media/default.nix +++ b/modules/nixos/services/media/default.nix @@ -8,7 +8,7 @@ inherit (lib) mkIf mkEnableOption mkOption; inherit (lib.types) str; - cfg = config.${namespace}.services.media; + cfg = config.sneeuwvlok.services.media; in { imports = [ ./glance @@ -19,7 +19,7 @@ in { ./servarr ]; - options.${namespace}.services.media = { + options.sneeuwvlok.services.media = { enable = mkEnableOption "Enable media services"; user = mkOption { diff --git a/modules/nixos/services/media/glance/default.nix b/modules/nixos/services/media/glance/default.nix index b042297..0e94a21 100644 --- a/modules/nixos/services/media/glance/default.nix +++ b/modules/nixos/services/media/glance/default.nix @@ -6,14 +6,14 @@ }: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.services.media.glance; + cfg = config.sneeuwvlok.services.media.glance; in { - options.${namespace}.services.media.glance = { + options.sneeuwvlok.services.media.glance = { enable = mkEnableOption "Enable Glance"; }; config = mkIf cfg.enable { - ${namespace}.services.networking.caddy.hosts = { + sneeuwvlok.services.networking.caddy.hosts = { "https://${config.networking.hostName}:443" = '' reverse_proxy http://[::1]:2000 ''; diff --git a/modules/nixos/services/media/jellyfin/default.nix b/modules/nixos/services/media/jellyfin/default.nix index e129cc4..2f8d43f 100644 --- a/modules/nixos/services/media/jellyfin/default.nix +++ b/modules/nixos/services/media/jellyfin/default.nix @@ -9,14 +9,14 @@ inherit (builtins) toString; inherit (lib) mkIf mkEnableOption mkOption types; - cfg = config.${namespace}.services.media.jellyfin; + cfg = config.sneeuwvlok.services.media.jellyfin; in { - options.${namespace}.services.media.jellyfin = { + options.sneeuwvlok.services.media.jellyfin = { enable = mkEnableOption "Enable jellyfin server"; }; config = mkIf cfg.enable { - ${namespace}.services.networking.caddy = { + sneeuwvlok.services.networking.caddy = { hosts = { "jellyfin.kruining.eu" = '' reverse_proxy http://[::1]:8096 diff --git a/modules/nixos/services/media/mydia/default.nix b/modules/nixos/services/media/mydia/default.nix index 3f2008a..9bfa87d 100644 --- a/modules/nixos/services/media/mydia/default.nix +++ b/modules/nixos/services/media/mydia/default.nix @@ -6,9 +6,9 @@ }: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.services.media.mydia; + cfg = config.sneeuwvlok.services.media.mydia; in { - options.${namespace}.services.media.mydia = { + options.sneeuwvlok.services.media.mydia = { enable = mkEnableOption "Enable Mydia"; }; diff --git a/modules/nixos/services/media/nextcloud/default.nix b/modules/nixos/services/media/nextcloud/default.nix index 06904c6..9a66fe1 100644 --- a/modules/nixos/services/media/nextcloud/default.nix +++ b/modules/nixos/services/media/nextcloud/default.nix @@ -8,9 +8,9 @@ inherit (lib) mkIf mkEnableOption mkOption; inherit (lib.types) str; - cfg = config.${namespace}.services.media.nextcloud; + cfg = config.sneeuwvlok.services.media.nextcloud; in { - options.${namespace}.services.media.nextcloud = { + options.sneeuwvlok.services.media.nextcloud = { enable = mkEnableOption "Nextcloud"; user = mkOption { @@ -25,7 +25,7 @@ in { }; config = mkIf cfg.enable { - ${namespace}.services.networking.caddy = { + sneeuwvlok.services.networking.caddy = { hosts."cloud.kruining.eu" = '' php_fastcgi unix//run/phpfpm/nextcloud.sock { env front_controller_active true diff --git a/modules/nixos/services/media/nfs/default.nix b/modules/nixos/services/media/nfs/default.nix index 54b58e7..efea82c 100644 --- a/modules/nixos/services/media/nfs/default.nix +++ b/modules/nixos/services/media/nfs/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.services.media.nfs; + cfg = config.sneeuwvlok.services.media.nfs; in { - options.${namespace}.services.media.nfs = { + options.sneeuwvlok.services.media.nfs = { enable = mkEnableOption "Enable NFS"; }; diff --git a/modules/nixos/services/media/servarr/default.nix b/modules/nixos/services/media/servarr/default.nix index 0b75d22..8f3e5db 100644 --- a/modules/nixos/services/media/servarr/default.nix +++ b/modules/nixos/services/media/servarr/default.nix @@ -9,11 +9,11 @@ inherit (builtins) toString; inherit (lib) mkIf mkEnableOption mkOption types; - cfg = config.${namespace}.services.media.servarr; + cfg = config.sneeuwvlok.services.media.servarr; servarr = import ./lib.nix {inherit lib;}; anyEnabled = cfg |> lib.attrNames |> lib.length |> (l: l > 0); in { - options.${namespace}.services.media = { + options.sneeuwvlok.services.media = { servarr = mkOption { type = types.attrsOf (types.submodule ({name, ...}: { options = { diff --git a/modules/nixos/services/networking/caddy/default.nix b/modules/nixos/services/networking/caddy/default.nix index 2d28435..f2ee8fd 100644 --- a/modules/nixos/services/networking/caddy/default.nix +++ b/modules/nixos/services/networking/caddy/default.nix @@ -8,14 +8,14 @@ inherit (builtins) length; inherit (lib) mkIf mkEnableOption mkOption types attrNames mapAttrs; - cfg = config.${namespace}.services.networking.caddy; + cfg = config.sneeuwvlok.services.networking.caddy; hasHosts = (cfg.hosts |> attrNames |> length) > 0; caddyPackage = pkgs.caddy.withPlugins { plugins = ["github.com/corazawaf/coraza-caddy/v2@v2.1.0"]; hash = "sha256-rsDnTunR8C7hVOX5aKcba+iFYHbpWek65DZgbMxOdTs="; }; in { - options.${namespace}.services.networking.caddy = { + options.sneeuwvlok.services.networking.caddy = { enable = mkEnableOption "enable caddy" // {default = true;}; hosts = mkOption { diff --git a/modules/nixos/services/networking/ssh/default.nix b/modules/nixos/services/networking/ssh/default.nix index 5ebdfd2..e0442d7 100644 --- a/modules/nixos/services/networking/ssh/default.nix +++ b/modules/nixos/services/networking/ssh/default.nix @@ -1,12 +1,15 @@ -{ config, lib, namespace, ... }: -let +{ + config, + lib, + namespace, + ... +}: let inherit (lib.modules) mkIf; inherit (lib.options) mkEnableOption; - cfg = config.${namespace}.services.networking.ssh; -in -{ - options.${namespace}.services.networking.ssh = { + cfg = config.sneeuwvlok.services.networking.ssh; +in { + options.sneeuwvlok.services.networking.ssh = { enable = mkEnableOption "enable ssh"; }; @@ -14,10 +17,10 @@ in services.openssh = { enable = true; openFirewall = true; - ports = [ 22 ]; + ports = [22]; settings = { PasswordAuthentication = true; - AllowUsers = [ "chris" "root" ]; + AllowUsers = ["chris" "root"]; UseDns = true; UsePAM = true; PermitRootLogin = "prohibit-password"; diff --git a/modules/nixos/services/networking/wireguard/default.nix b/modules/nixos/services/networking/wireguard/default.nix index 0cf5320..bf22a53 100644 --- a/modules/nixos/services/networking/wireguard/default.nix +++ b/modules/nixos/services/networking/wireguard/default.nix @@ -8,10 +8,10 @@ inherit (builtins) length; inherit (lib) mkIf mkEnableOption mkOption types attrNames attrsToList listToAttrs; - cfg = config.${namespace}.services.networking.wireguard; + cfg = config.sneeuwvlok.services.networking.wireguard; hasPeers = (cfg.peer |> attrNames |> length) > 0; in { - options.${namespace}.services.networking.wireguard = { + options.sneeuwvlok.services.networking.wireguard = { # enable = mkEnableOption "enable wireguard" // {default = true;}; peer = mkOption { diff --git a/modules/nixos/services/observability/grafana/default.nix b/modules/nixos/services/observability/grafana/default.nix index a867351..40fdc38 100644 --- a/modules/nixos/services/observability/grafana/default.nix +++ b/modules/nixos/services/observability/grafana/default.nix @@ -8,12 +8,12 @@ inherit (lib.modules) mkIf; inherit (lib.options) mkEnableOption; - cfg = config.${namespace}.services.observability.grafana; + cfg = config.sneeuwvlok.services.observability.grafana; db_user = "grafana"; db_name = "grafana"; in { - options.${namespace}.services.observability.grafana = { + options.sneeuwvlok.services.observability.grafana = { enable = mkEnableOption "enable Grafana"; }; diff --git a/modules/nixos/services/observability/loki/default.nix b/modules/nixos/services/observability/loki/default.nix index d4774ac..abe42ca 100644 --- a/modules/nixos/services/observability/loki/default.nix +++ b/modules/nixos/services/observability/loki/default.nix @@ -1,12 +1,16 @@ -{ pkgs, config, lib, namespace, ... }: -let +{ + pkgs, + config, + lib, + namespace, + ... +}: let inherit (lib.modules) mkIf; inherit (lib.options) mkEnableOption; - cfg = config.${namespace}.services.observability.loki; -in -{ - options.${namespace}.services.observability.loki = { + cfg = config.sneeuwvlok.services.observability.loki; +in { + options.sneeuwvlok.services.observability.loki = { enable = mkEnableOption "enable Grafana Loki"; }; @@ -44,6 +48,6 @@ in }; }; - networking.firewall.allowedTCPPorts = [ 9003 ]; + networking.firewall.allowedTCPPorts = [9003]; }; } diff --git a/modules/nixos/services/observability/prometheus/default.nix b/modules/nixos/services/observability/prometheus/default.nix index af5ee9d..191d7c1 100644 --- a/modules/nixos/services/observability/prometheus/default.nix +++ b/modules/nixos/services/observability/prometheus/default.nix @@ -3,10 +3,10 @@ let inherit (builtins) toString; inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.services.observability.prometheus; + cfg = config.sneeuwvlok.services.observability.prometheus; in { - options.${namespace}.services.observability.prometheus = { + options.sneeuwvlok.services.observability.prometheus = { enable = mkEnableOption "enable Prometheus"; }; diff --git a/modules/nixos/services/observability/promtail/default.nix b/modules/nixos/services/observability/promtail/default.nix index 38dbbab..80bac51 100644 --- a/modules/nixos/services/observability/promtail/default.nix +++ b/modules/nixos/services/observability/promtail/default.nix @@ -8,9 +8,9 @@ inherit (lib.modules) mkIf; inherit (lib.options) mkEnableOption; - cfg = config.${namespace}.services.observability.promtail; + cfg = config.sneeuwvlok.services.observability.promtail; in { - options.${namespace}.services.observability.promtail = { + options.sneeuwvlok.services.observability.promtail = { enable = mkEnableOption "enable Grafana Promtail"; }; diff --git a/modules/nixos/services/observability/uptime-kuma/default.nix b/modules/nixos/services/observability/uptime-kuma/default.nix index c23977b..619da55 100644 --- a/modules/nixos/services/observability/uptime-kuma/default.nix +++ b/modules/nixos/services/observability/uptime-kuma/default.nix @@ -1,12 +1,16 @@ -{ pkgs, config, lib, namespace, ... }: -let +{ + pkgs, + config, + lib, + namespace, + ... +}: let inherit (builtins) toString; inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.services.observability.uptime-kuma; -in -{ - options.${namespace}.services.observability.uptime-kuma = { + cfg = config.sneeuwvlok.services.observability.uptime-kuma; +in { + options.sneeuwvlok.services.observability.uptime-kuma = { enable = mkEnableOption "enable uptime kuma"; }; @@ -19,7 +23,7 @@ in HOST = "0.0.0.0"; }; }; - - networking.firewall.allowedTCPPorts = [ 9006 ]; + + networking.firewall.allowedTCPPorts = [9006]; }; } diff --git a/modules/nixos/services/persistance/postgesql/default.nix b/modules/nixos/services/persistance/postgesql/default.nix index 403c07c..7d06daa 100644 --- a/modules/nixos/services/persistance/postgesql/default.nix +++ b/modules/nixos/services/persistance/postgesql/default.nix @@ -7,9 +7,9 @@ }: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.services.persistance.postgresql; + cfg = config.sneeuwvlok.services.persistance.postgresql; in { - options.${namespace}.services.persistance.postgresql = { + options.sneeuwvlok.services.persistance.postgresql = { enable = mkEnableOption "Postgresql"; }; diff --git a/modules/nixos/services/security/vaultwarden/default.nix b/modules/nixos/services/security/vaultwarden/default.nix index c3b75b2..9fa4687 100644 --- a/modules/nixos/services/security/vaultwarden/default.nix +++ b/modules/nixos/services/security/vaultwarden/default.nix @@ -10,7 +10,7 @@ inherit (builtins) toString; inherit (lib) mkIf mkEnableOption mkOption types getAttrs toUpper concatMapAttrsStringSep; - cfg = config.${namespace}.services.security.vaultwarden; + cfg = config.sneeuwvlok.services.security.vaultwarden; databaseProviderSqlite = types.submodule ({...}: { options = { @@ -78,7 +78,7 @@ // (urlOptions |> getAttrs ["protocol" "host" "port"]); }); in { - options.${namespace}.services.security.vaultwarden = { + options.sneeuwvlok.services.security.vaultwarden = { enable = mkEnableOption "enable vaultwarden"; database = mkOption { @@ -93,7 +93,7 @@ in { }; config = mkIf cfg.enable { - ${namespace}.services.networking.caddy.hosts = { + sneeuwvlok.services.networking.caddy.hosts = { "vault.kruining.eu" = '' encode zstd gzip diff --git a/modules/nixos/services/virtualisation/podman/default.nix b/modules/nixos/services/virtualisation/podman/default.nix index 0faf8ce..c827677 100644 --- a/modules/nixos/services/virtualisation/podman/default.nix +++ b/modules/nixos/services/virtualisation/podman/default.nix @@ -1,11 +1,16 @@ -{ config, options, lib, pkgs, namespace, ... }: -let +{ + config, + options, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.services.virtualisation.podman; -in -{ - options.${namespace}.services.virtualisation.podman = { + cfg = config.sneeuwvlok.services.virtualisation.podman; +in { + options.sneeuwvlok.services.virtualisation.podman = { enable = mkEnableOption "enable podman"; }; diff --git a/modules/nixos/shells/default.nix b/modules/nixos/shells/default.nix deleted file mode 100644 index ea8f50d..0000000 --- a/modules/nixos/shells/default.nix +++ /dev/null @@ -1,2 +0,0 @@ -{...}: { -} diff --git a/modules/nixos/shells/zsh/default.nix b/modules/nixos/shells/zsh/default.nix index 399e7dd..1d9adb7 100644 --- a/modules/nixos/shells/zsh/default.nix +++ b/modules/nixos/shells/zsh/default.nix @@ -1,11 +1,16 @@ -{ inputs, config, lib, pkgs, namespace, ... }: -let +{ + inputs, + config, + lib, + pkgs, + namespace, + ... +}: let inherit (lib) mkIf mkEnableOption; - cfg = config.${namespace}.shell.zsh; -in -{ - options.${namespace}.shell.zsh = { + cfg = config.sneeuwvlok.shell.zsh; +in { + options.sneeuwvlok.shell.zsh = { enable = mkEnableOption "enable zsh shell"; }; diff --git a/modules/nixos/system/default.nix b/modules/nixos/system/default.nix deleted file mode 100644 index 4abcf82..0000000 --- a/modules/nixos/system/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - imports = [ - ./networking - ./security - ]; -} diff --git a/modules/nixos/system/networking/default.nix b/modules/nixos/system/networking/default.nix index c61a81b..ab8842c 100644 --- a/modules/nixos/system/networking/default.nix +++ b/modules/nixos/system/networking/default.nix @@ -2,10 +2,10 @@ let inherit (lib) mkDefault; - cfg = config.${namespace}.system.networking; + cfg = config.sneeuwvlok.system.networking; in { - options.${namespace}.system.networking = {}; + options.sneeuwvlok.system.networking = {}; config = { systemd.services.NetworkManager-wait-online.enable = false; diff --git a/modules/nixos/system/security/boot/default.nix b/modules/nixos/system/security/boot/default.nix index ccf1f83..f911a7a 100644 --- a/modules/nixos/system/security/boot/default.nix +++ b/modules/nixos/system/security/boot/default.nix @@ -1,13 +1,16 @@ -{ config, namespace, inputs, ... }: -let - cfg = config.${namespace}.system.security.boot; -in { - options.${namespace}.system.security.boot = {}; + config, + namespace, + inputs, + ... +}: let + cfg = config.sneeuwvlok.system.security.boot; +in { + options.sneeuwvlok.system.security.boot = {}; config = { boot = { - kernelModules = [ "tcp_bbr" ]; + kernelModules = ["tcp_bbr"]; kernel.sysctl = { ## TCP hardening # Prevent bogus ICMP errors from filling up logs. @@ -43,4 +46,4 @@ in }; }; }; -} \ No newline at end of file +} diff --git a/modules/nixos/system/security/default.nix b/modules/nixos/system/security/default.nix index 17d34f9..0b440b0 100644 --- a/modules/nixos/system/security/default.nix +++ b/modules/nixos/system/security/default.nix @@ -1,29 +1,28 @@ -{ config, namespace, inputs, ... }: -let - cfg = config.${namespace}.system.security; -in -{ - imports = [ - ./boot - ./sops - ./sudo - ]; +{...}: { + flake.modules.nixos.sneeuwvlok.system.security = { + config, + namespace, + inputs, + ... + }: let + cfg = config.sneeuwvlok.system.security; + in { + options.sneeuwvlok.system.security = {}; - options.${namespace}.system.security = {}; + config = { + security = { + acme.acceptTerms = true; + polkit.enable = true; - config = { - security = { - acme.acceptTerms = true; - polkit.enable = true; - - pam = { - u2f = { - enable = true; - settings.cue = true; + pam = { + u2f = { + enable = true; + settings.cue = true; + }; }; }; - }; - programs.gnupg.agent.enable = true; + programs.gnupg.agent.enable = true; + }; }; } diff --git a/modules/nixos/system/security/sops/default.nix b/modules/nixos/system/security/sops/default.nix index 1583104..caef7be 100644 --- a/modules/nixos/system/security/sops/default.nix +++ b/modules/nixos/system/security/sops/default.nix @@ -1,12 +1,16 @@ -{ pkgs, config, namespace, repoRoot, ... }: -let - cfg = config.${namespace}.system.security.sops; -in { - options.${namespace}.system.security.sops = {}; + pkgs, + config, + namespace, + repoRoot, + ... +}: let + cfg = config.sneeuwvlok.system.security.sops; +in { + options.sneeuwvlok.system.security.sops = {}; config = { - environment.systemPackages = with pkgs; [ sops ]; + environment.systemPackages = with pkgs; [sops]; sops = { defaultSopsFormat = "yaml"; diff --git a/modules/nixos/system/security/sudo/default.nix b/modules/nixos/system/security/sudo/default.nix index b79efbc..11f99d2 100644 --- a/modules/nixos/system/security/sudo/default.nix +++ b/modules/nixos/system/security/sudo/default.nix @@ -1,9 +1,9 @@ { config, namespace, ... }: let - cfg = config.${namespace}.system.security.sudo; + cfg = config.sneeuwvlok.system.security.sudo; in { - options.${namespace}.system.security.sudo = {}; + options.sneeuwvlok.system.security.sudo = {}; config = { security = { diff --git a/packages/default.nix b/packages/default.nix deleted file mode 100644 index 11752d1..0000000 --- a/packages/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - config, - lib, - mkPkgs, - ... -}: { - imports = [ - ./studio - ./vaultwarden - ]; - - perSystem = {system, ...}: let - pkgs = mkPkgs system; - in { - _module.args.pkgs = pkgs; - - clan.pkgs = pkgs; - }; - - flake.overlays.default = lib.composeManyExtensions [ - config.flake.overlays."package/studio" - config.flake.overlays."package/vaultwarden" - ]; -} diff --git a/packages/flake-module.nix b/packages/flake-module.nix new file mode 100644 index 0000000..c6a1225 --- /dev/null +++ b/packages/flake-module.nix @@ -0,0 +1,14 @@ +{inputs, ...}: { + imports = []; + + perSystem = { + system, + pkgs, + ... + }: { + packages = { + studio = pkgs.callPackage ./studio {erosanix = inputs.erosanix.lib.${system};}; + vaultwarden = pkgs.callPackage ./vaultwarden {}; + }; + }; +} diff --git a/packages/studio/default.nix b/packages/studio/default.nix index cfd99fe..10ae62c 100644 --- a/packages/studio/default.nix +++ b/packages/studio/default.nix @@ -1,16 +1,100 @@ -{inputs, lib, ...}: { - perSystem = {pkgs, system, ...}: { - packages = lib.optionalAttrs (system == "x86_64-linux") { - studio = pkgs.callPackage ./package.nix { - erosanixLib = inputs.erosanix.lib; - }; - }; - }; +{ + pkgs, + erosanix, +}: let + inherit (builtins) fetchurl replaceStrings; + inherit (pkgs) makeDesktopItem copyDesktopItems wineWow64Packages; + inherit (erosanix) mkWindowsAppNoCC makeDesktopIcon copyDesktopIcons; - flake.overlays."package/studio" = final: _prev: - lib.optionalAttrs (final.stdenv.hostPlatform.system == "x86_64-linux") { - studio = final.callPackage ./package.nix { - erosanixLib = inputs.erosanix.lib; - }; + wine = wineWow64Packages.base; +in + mkWindowsAppNoCC rec { + inherit wine; + + pname = "studio"; + version = "2.25.12"; + + src = fetchurl { + url = "https://studio.download.bricklink.info/Studio2.0+EarlyAccess/Archive/2.25.12_1/Studio+2.0+EarlyAccess.exe"; + sha256 = "sha256:1xl3zvzkzr64zphk7rnpfx3whhbaykzw06m3nd5dc12r2p4sdh3v"; }; -} + + enableMonoBootPrompt = false; + dontUnpack = true; + + wineArch = "win64"; + enableInstallNotification = true; + + fileMap = { + "$HOME/.config/${pname}/Stud.io" = "drive_c/users/$USER/AppData/Local/Stud.io"; + "$HOME/.config/${pname}/Bricklink" = "drive_c/users/$USER/AppData/LocalLow/Bricklink"; + }; + + fileMapDuringAppInstall = false; + + persistRegistry = false; + persistRuntimeLayer = true; + inputHashMethod = "version"; + + enableVulkan = false; + rendererOverride = null; + + enableHUD = false; + + enabledWineSymlinks = {}; + graphicsDriver = "auto"; + inhibitIdle = false; + + nativeBuildInputs = [copyDesktopIcons copyDesktopItems]; + + winAppInstall = replaceStrings ["\r"] [""] '' + wine64 ${src} + + wineserver -W + wine64 reg add 'HKEY_CURRENT_USER\Software\Wine\X11 Driver' /t REG_SZ /v UseTakeFocus /d N /f + ''; + + winAppPreRun = replaceStrings ["\r"] [""] '' + wineserver -W + wine64 reg add 'HKEY_CURRENT_USER\Software\Wine\X11 Driver' /t REG_SZ /v UseTakeFocus /d N /f + ''; + + winAppRun = replaceStrings ["\r"] [""] '' + wine64 "$WINEPREFIX/drive_c/Program Files/Studio 2.0/Studio.exe" "$ARGS" + ''; + + winAppPostRun = ""; + installPhase = replaceStrings ["\r"] [""] '' + runHook preInstall + + ln -s $out/bin/.launcher $out/bin/${pname} + + runHook postInstall + ''; + + desktopItems = [ + (makeDesktopItem { + mimeTypes = []; + + name = pname; + exec = pname; + icon = pname; + desktopName = "Bricklink studio"; + genericName = "Lego creation app"; + categories = []; + }) + ]; + + desktopIcon = makeDesktopIcon { + name = pname; + src = ./studio.png; + }; + + meta = { + description = "App for creating lego builds"; + homepage = "https://www.bricklink.com/v3/studio/main.page"; + license = ""; + maintainers = []; + platforms = ["x86_64-linux"]; + }; + } diff --git a/packages/studio/package.nix b/packages/studio/package.nix deleted file mode 100644 index 7b40c68..0000000 --- a/packages/studio/package.nix +++ /dev/null @@ -1,100 +0,0 @@ -{ - pkgs, - erosanixLib, -}: let - inherit (builtins) fetchurl replaceStrings; - inherit (pkgs) makeDesktopItem copyDesktopItems wineWow64Packages; - inherit (erosanixLib.x86_64-linux) mkWindowsAppNoCC makeDesktopIcon copyDesktopIcons; - - wine = wineWow64Packages.base; -in - mkWindowsAppNoCC rec { - inherit wine; - - pname = "studio"; - version = "2.25.12"; - - src = fetchurl { - url = "https://studio.download.bricklink.info/Studio2.0+EarlyAccess/Archive/2.25.12_1/Studio+2.0+EarlyAccess.exe"; - sha256 = "sha256:1xl3zvzkzr64zphk7rnpfx3whhbaykzw06m3nd5dc12r2p4sdh3v"; - }; - - enableMonoBootPrompt = false; - dontUnpack = true; - - wineArch = "win64"; - enableInstallNotification = true; - - fileMap = { - "$HOME/.config/${pname}/Stud.io" = "drive_c/users/$USER/AppData/Local/Stud.io"; - "$HOME/.config/${pname}/Bricklink" = "drive_c/users/$USER/AppData/LocalLow/Bricklink"; - }; - - fileMapDuringAppInstall = false; - - persistRegistry = false; - persistRuntimeLayer = true; - inputHashMethod = "version"; - - enableVulkan = false; - rendererOverride = null; - - enableHUD = false; - - enabledWineSymlinks = {}; - graphicsDriver = "auto"; - inhibitIdle = false; - - nativeBuildInputs = [copyDesktopIcons copyDesktopItems]; - - winAppInstall = replaceStrings ["\r"] [""] '' - wine64 ${src} - - wineserver -W - wine64 reg add 'HKEY_CURRENT_USER\Software\Wine\X11 Driver' /t REG_SZ /v UseTakeFocus /d N /f - ''; - - winAppPreRun = replaceStrings ["\r"] [""] '' - wineserver -W - wine64 reg add 'HKEY_CURRENT_USER\Software\Wine\X11 Driver' /t REG_SZ /v UseTakeFocus /d N /f - ''; - - winAppRun = replaceStrings ["\r"] [""] '' - wine64 "$WINEPREFIX/drive_c/Program Files/Studio 2.0/Studio.exe" "$ARGS" - ''; - - winAppPostRun = ""; - installPhase = replaceStrings ["\r"] [""] '' - runHook preInstall - - ln -s $out/bin/.launcher $out/bin/${pname} - - runHook postInstall - ''; - - desktopItems = [ - (makeDesktopItem { - mimeTypes = []; - - name = pname; - exec = pname; - icon = pname; - desktopName = "Bricklink studio"; - genericName = "Lego creation app"; - categories = []; - }) - ]; - - desktopIcon = makeDesktopIcon { - name = pname; - src = ./studio.png; - }; - - meta = { - description = "App for creating lego builds"; - homepage = "https://www.bricklink.com/v3/studio/main.page"; - license = ""; - maintainers = []; - platforms = ["x86_64-linux"]; - }; - } diff --git a/packages/vaultwarden/default.nix b/packages/vaultwarden/default.nix index 035b6da..c4642fd 100644 --- a/packages/vaultwarden/default.nix +++ b/packages/vaultwarden/default.nix @@ -1,9 +1,28 @@ -{lib, ...}: { - perSystem = {pkgs, ...}: { - packages.vaultwarden = pkgs.callPackage ./package.nix {}; +{lib, stdenv, rustPlatform, fetchFromGitHub, openssl, pkg-config, postgresql, dbBackend ? "postgresql", ...}: +rustPlatform.buildRustPackage rec { + pname = "vaultwarden"; + version = "1.34.3"; + + src = fetchFromGitHub { + owner = "Timshel"; + repo = "vaultwarden"; + rev = "1.34.3"; + hash = "sha256-Dj0ySVRvBZ/57+UHas3VI8bi/0JBRqn0IW1Dq+405J0="; }; - flake.overlays."package/vaultwarden" = final: _prev: { - vaultwarden = final.callPackage ./package.nix {}; + cargoHash = "sha256-4sDagd2XGamBz1XvDj4ycRVJ0F+4iwHOPlj/RglNDqE="; + + env.VW_VERSION = version; + + nativeBuildInputs = [pkg-config]; + buildInputs = + [openssl] + ++ lib.optional (dbBackend == "postgresql") postgresql; + + buildFeatures = dbBackend; + + meta = with lib; { + license = licenses.agpl3Only; + mainProgram = "vaultwarden"; }; } diff --git a/packages/vaultwarden/package.nix b/packages/vaultwarden/package.nix deleted file mode 100644 index c4642fd..0000000 --- a/packages/vaultwarden/package.nix +++ /dev/null @@ -1,28 +0,0 @@ -{lib, stdenv, rustPlatform, fetchFromGitHub, openssl, pkg-config, postgresql, dbBackend ? "postgresql", ...}: -rustPlatform.buildRustPackage rec { - pname = "vaultwarden"; - version = "1.34.3"; - - src = fetchFromGitHub { - owner = "Timshel"; - repo = "vaultwarden"; - rev = "1.34.3"; - hash = "sha256-Dj0ySVRvBZ/57+UHas3VI8bi/0JBRqn0IW1Dq+405J0="; - }; - - cargoHash = "sha256-4sDagd2XGamBz1XvDj4ycRVJ0F+4iwHOPlj/RglNDqE="; - - env.VW_VERSION = version; - - nativeBuildInputs = [pkg-config]; - buildInputs = - [openssl] - ++ lib.optional (dbBackend == "postgresql") postgresql; - - buildFeatures = dbBackend; - - meta = with lib; { - license = licenses.agpl3Only; - mainProgram = "vaultwarden"; - }; -}