diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index 96bb969..65cc20d 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -26,10 +26,3 @@ jobs: - uses: actions/checkout@v4 - uses: DeterminateSystems/nix-installer-action@main - run: nix build .#nixosConfigurations.minimal-server-iso.config.system.build.isoImage - build-darwin: - name: Build darwin systems - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - run: nix build .#darwinConfigurations.WQ0C6FWJ1W.config.system.build.toplevel diff --git a/flake.lock b/flake.lock index 470bbd3..3ef13df 100644 --- a/flake.lock +++ b/flake.lock @@ -216,26 +216,6 @@ } }, "nix-darwin": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1730589595, - "narHash": "sha256-QI//TRTTmkUM0bz+KhdanRcwzlYib6PjMTvhC3dwUWA=", - "owner": "LnL7", - "repo": "nix-darwin", - "rev": "146629a54364f6b54e7f3d15c44fea69ed0bf476", - "type": "github" - }, - "original": { - "owner": "LnL7", - "repo": "nix-darwin", - "type": "github" - } - }, - "nix-darwin_2": { "inputs": { "nixpkgs": [ "nixvim", @@ -360,7 +340,7 @@ "home-manager": [ "home-manager" ], - "nix-darwin": "nix-darwin_2", + "nix-darwin": "nix-darwin", "nixpkgs": [ "nixpkgs" ], @@ -403,7 +383,6 @@ "disko": "disko", "flake-utils": "flake-utils", "home-manager": "home-manager", - "nix-darwin": "nix-darwin", "nixos-facter-modules": "nixos-facter-modules", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", diff --git a/flake.nix b/flake.nix index d3e2b14..611b4c0 100644 --- a/flake.nix +++ b/flake.nix @@ -17,10 +17,6 @@ url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; }; - nix-darwin = { - url = "github:LnL7/nix-darwin"; - inputs.nixpkgs.follows = "nixpkgs"; - }; nixos-facter-modules.url = "github:numtide/nixos-facter-modules"; nixos-hardware.url = "github:nixos/nixos-hardware/master"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; diff --git a/home/default.nix b/home/default.nix index 36a178f..2ebca77 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,14 +1,12 @@ -{pkgs, ...}: { +{...}: { imports = [ ./desktop ./java - ./profiles ./terminal ]; config = { my.home = { - desktop.enable = pkgs.stdenv.isLinux; - + desktop.enable = true; java.enable = true; terminal.enable = true; }; diff --git a/home/java/default.nix b/home/java/default.nix index 219d644..77e3ccd 100644 --- a/home/java/default.nix +++ b/home/java/default.nix @@ -20,7 +20,12 @@ in { package = pkgs.jdk21; }; - programs.gradle.enable = true; + programs.gradle = { + enable = true; + settings = { + "org.gradle.java.installations.paths" = "${pkgs.jdk8},${pkgs.jdk11}"; + }; + }; my.home.helix-java-support.enable = true; }; diff --git a/home/profiles/default.nix b/home/profiles/default.nix deleted file mode 100644 index 9a4a8f4..0000000 --- a/home/profiles/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - config, - osConfig, - ... -}: let - inherit (osConfig.my.host) profiles; -in { - imports = [ - ./private.nix - ./work.nix - ]; - - config = { - my.home.profiles = { - private.enable = builtins.elem "private" profiles; - work.enable = builtins.elem "work" profiles; - }; - }; -} diff --git a/home/profiles/private.nix b/home/profiles/private.nix deleted file mode 100644 index a9097e7..0000000 --- a/home/profiles/private.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: let - cfg = config.my.home.profiles.private; -in { - options.my.home.profiles.private = { - enable = lib.mkEnableOption "private-profile"; - }; - - config = lib.mkIf cfg.enable { - programs.gradle = { - settings = { - "org.gradle.java.installations.paths" = "${pkgs.jdk8},${pkgs.jdk11}"; - }; - }; - programs.git = { - includes = [ - { - condition = "gitdir:~/github/gradlex-org/"; - contents = { - user.email = "benedikt@gradlex.org"; - user.signingKey = "757DE51A2FD1489D"; - }; - } - { - condition = "gitdir:~/github/apache/"; - contents = { - user.email = "britter@apache.org"; - user.signingKey = "9DAADC1C9FCC82D0"; - }; - } - ]; - }; - }; -} diff --git a/home/profiles/work.nix b/home/profiles/work.nix deleted file mode 100644 index 23da58f..0000000 --- a/home/profiles/work.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: let - cfg = config.my.home.profiles.work; -in { - options.my.home.profiles.work = { - enable = lib.mkEnableOption "work-profile"; - }; - - config = lib.mkIf cfg.enable { - home.sessionVariables = with pkgs; { - JDK8 = jdk8; - JDK11 = jdk11; - JDK17 = jdk17; - JDK20 = jdk20; - JDK21 = jdk21; - }; - - home.packages = with pkgs; [ - awscli2 - k3d - kubernetes-helm - kustomize - shellcheck - ]; - - my.home.terminal.tmux.enable = true; - - programs.fish.shellAliases = { - dive = "docker run -ti --rm -v /var/run/docker.sock:/var/run/docker.sock wagoodman/dive"; - }; - - programs.git.ignores = [ - ".DS_Store" - ]; - }; -} diff --git a/home/terminal/git.nix b/home/terminal/git.nix index 5171baa..b9752ec 100644 --- a/home/terminal/git.nix +++ b/home/terminal/git.nix @@ -26,6 +26,23 @@ in { key = osUser.signingKey; }; + includes = [ + { + condition = "gitdir:~/github/gradlex-org/"; + contents = { + user.email = "benedikt@gradlex.org"; + user.signingKey = "757DE51A2FD1489D"; + }; + } + { + condition = "gitdir:~/github/apache/"; + contents = { + user.email = "britter@apache.org"; + user.signingKey = "9DAADC1C9FCC82D0"; + }; + } + ]; + extraConfig = { init.defaultBranch = "main"; push.autoSetupRemote = "true"; diff --git a/lib.nix b/lib.nix index cdcf089..f97f846 100644 --- a/lib.nix +++ b/lib.nix @@ -1,8 +1,8 @@ let defineSystems = inputs: let systems = builtins.mapAttrs (k: _v: builtins.readDir ./systems/${k}) (builtins.readDir ./systems); - configuration = builder: system: hostName: - builder { + nixosConfiguration = system: hostName: + inputs.nixpkgs.lib.nixosSystem { inherit system; specialArgs = { inherit inputs; @@ -18,21 +18,12 @@ let name = hostName; value = builder arch hostName; }) (builtins.attrNames systems.${arch}); - nixosConfiguration = arch: hostName: - configuration inputs.nixpkgs.lib.nixosSystem arch hostName; nixosConfigurations = let nixosConfigurationAttrs = aarch: configurationAttrs nixosConfiguration aarch; in builtins.listToAttrs (nixosConfigurationAttrs "aarch64-linux" ++ nixosConfigurationAttrs "x86_64-linux"); - darwinConfiguration = arch: hostName: - configuration inputs.nix-darwin.lib.darwinSystem arch hostName; - darwinConfigurations = let - darwinConfigurationAttrs = aarch: configurationAttrs darwinConfiguration aarch; - in - builtins.listToAttrs (darwinConfigurationAttrs "aarch64-darwin"); in { inherit nixosConfigurations; - inherit darwinConfigurations; }; lib = { inherit defineSystems; diff --git a/modules/nixos/1password/default.nix b/modules/1password/default.nix similarity index 100% rename from modules/nixos/1password/default.nix rename to modules/1password/default.nix diff --git a/modules/nixos/acme/default.nix b/modules/acme/default.nix similarity index 100% rename from modules/nixos/acme/default.nix rename to modules/acme/default.nix diff --git a/modules/nixos/adguard/default.nix b/modules/adguard/default.nix similarity index 100% rename from modules/nixos/adguard/default.nix rename to modules/adguard/default.nix diff --git a/modules/nixos/comin/default.nix b/modules/comin/default.nix similarity index 100% rename from modules/nixos/comin/default.nix rename to modules/comin/default.nix diff --git a/modules/common/default.nix b/modules/common/default.nix deleted file mode 100644 index c1c5705..0000000 --- a/modules/common/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{...}: { - imports = [ - ./home-manager - ./options - ./utilities - ]; -} diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix deleted file mode 100644 index 7cbc123..0000000 --- a/modules/darwin/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{...}: { - imports = [ - ../common - ./my-user - ]; -} diff --git a/modules/darwin/my-user/default.nix b/modules/darwin/my-user/default.nix deleted file mode 100644 index da420b8..0000000 --- a/modules/darwin/my-user/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - config, - pkgs, - inputs, - ... -}: let - cfg = config.my.user; -in { - imports = [ - inputs.home-manager.darwinModules.home-manager - ]; - - config = { - users.users.${cfg.name} = { - inherit (cfg) name; - home = "/Users/${cfg.name}"; - shell = pkgs.fish; - }; - my.modules.home-manager.enable = true; - }; -} diff --git a/modules/nixos/default.nix b/modules/default.nix similarity index 88% rename from modules/nixos/default.nix rename to modules/default.nix index fd41ad2..2713723 100644 --- a/modules/nixos/default.nix +++ b/modules/default.nix @@ -2,7 +2,6 @@ cfg = config.my.host; in { imports = [ - ../common ./1password ./acme ./adguard @@ -14,6 +13,7 @@ in { ./gaming ./grafana ./homelab + ./home-manager ./homepage ./https-proxy ./i18n @@ -22,6 +22,7 @@ in { ./networking ./nextcloud ./nix + ./options ./proxmox-vm ./sops ./sound @@ -38,9 +39,7 @@ in { my-user.enable = cfg.role == "desktop"; sound.enable = cfg.role == "desktop"; sway.enable = cfg.role == "desktop"; - - # enabled only on private desktops - gaming.enable = cfg.role == "desktop" && (builtins.elem "private" cfg.profiles); + gaming.enable = cfg.role == "desktop"; # enabled only on servers comin.enable = cfg.role == "server"; diff --git a/modules/nixos/disko/btrfs-luks.nix b/modules/disko/btrfs-luks.nix similarity index 100% rename from modules/nixos/disko/btrfs-luks.nix rename to modules/disko/btrfs-luks.nix diff --git a/modules/nixos/disko/default.nix b/modules/disko/default.nix similarity index 100% rename from modules/nixos/disko/default.nix rename to modules/disko/default.nix diff --git a/modules/nixos/disko/ext-mbr.nix b/modules/disko/ext-mbr.nix similarity index 100% rename from modules/nixos/disko/ext-mbr.nix rename to modules/disko/ext-mbr.nix diff --git a/modules/nixos/dyndns/default.nix b/modules/dyndns/default.nix similarity index 100% rename from modules/nixos/dyndns/default.nix rename to modules/dyndns/default.nix diff --git a/modules/nixos/fonts/default.nix b/modules/fonts/default.nix similarity index 100% rename from modules/nixos/fonts/default.nix rename to modules/fonts/default.nix diff --git a/modules/nixos/fritzbox-cloudflare-dyndns/default.nix b/modules/fritzbox-cloudflare-dyndns/default.nix similarity index 100% rename from modules/nixos/fritzbox-cloudflare-dyndns/default.nix rename to modules/fritzbox-cloudflare-dyndns/default.nix diff --git a/modules/nixos/gaming/default.nix b/modules/gaming/default.nix similarity index 100% rename from modules/nixos/gaming/default.nix rename to modules/gaming/default.nix diff --git a/modules/nixos/grafana/default.nix b/modules/grafana/default.nix similarity index 100% rename from modules/nixos/grafana/default.nix rename to modules/grafana/default.nix diff --git a/modules/nixos/grafana/loki.nix b/modules/grafana/loki.nix similarity index 100% rename from modules/nixos/grafana/loki.nix rename to modules/grafana/loki.nix diff --git a/modules/nixos/grafana/prometheus.nix b/modules/grafana/prometheus.nix similarity index 100% rename from modules/nixos/grafana/prometheus.nix rename to modules/grafana/prometheus.nix diff --git a/modules/common/home-manager/default.nix b/modules/home-manager/default.nix similarity index 95% rename from modules/common/home-manager/default.nix rename to modules/home-manager/default.nix index bed6351..8aca26b 100644 --- a/modules/common/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -19,7 +19,7 @@ in { imports = [ inputs.catppuccin.homeManagerModules.catppuccin inputs.nixvim.homeManagerModules.nixvim - ../../../home + ../../home ]; }; }; diff --git a/modules/nixos/homelab/default.nix b/modules/homelab/default.nix similarity index 100% rename from modules/nixos/homelab/default.nix rename to modules/homelab/default.nix diff --git a/modules/nixos/homepage/default.nix b/modules/homepage/default.nix similarity index 100% rename from modules/nixos/homepage/default.nix rename to modules/homepage/default.nix diff --git a/modules/nixos/https-proxy/default.nix b/modules/https-proxy/default.nix similarity index 100% rename from modules/nixos/https-proxy/default.nix rename to modules/https-proxy/default.nix diff --git a/modules/nixos/i18n/default.nix b/modules/i18n/default.nix similarity index 100% rename from modules/nixos/i18n/default.nix rename to modules/i18n/default.nix diff --git a/modules/nixos/monitoring/default.nix b/modules/monitoring/default.nix similarity index 100% rename from modules/nixos/monitoring/default.nix rename to modules/monitoring/default.nix diff --git a/modules/nixos/my-user/default.nix b/modules/my-user/default.nix similarity index 95% rename from modules/nixos/my-user/default.nix rename to modules/my-user/default.nix index 90c8462..fa1222c 100644 --- a/modules/nixos/my-user/default.nix +++ b/modules/my-user/default.nix @@ -21,6 +21,7 @@ in { extraGroups = ["networkmanager" "wheel"]; shell = pkgs.fish; }; + programs.fish.enable = true; my.modules.home-manager.enable = true; # unfree packages used in home-manager configuration my.modules.allowedUnfreePkgs = [ diff --git a/modules/nixos/networking/default.nix b/modules/networking/default.nix similarity index 100% rename from modules/nixos/networking/default.nix rename to modules/networking/default.nix diff --git a/modules/nixos/nextcloud/default.nix b/modules/nextcloud/default.nix similarity index 100% rename from modules/nixos/nextcloud/default.nix rename to modules/nextcloud/default.nix diff --git a/modules/nixos/nextcloud/memories.nix b/modules/nextcloud/memories.nix similarity index 100% rename from modules/nixos/nextcloud/memories.nix rename to modules/nextcloud/memories.nix diff --git a/modules/nixos/nextcloud/richdocuments.nix b/modules/nextcloud/richdocuments.nix similarity index 100% rename from modules/nixos/nextcloud/richdocuments.nix rename to modules/nextcloud/richdocuments.nix diff --git a/modules/nixos/nix/default.nix b/modules/nix/default.nix similarity index 100% rename from modules/nixos/nix/default.nix rename to modules/nix/default.nix diff --git a/modules/common/options/default.nix b/modules/options/default.nix similarity index 83% rename from modules/common/options/default.nix rename to modules/options/default.nix index 390b9c3..5d9e967 100644 --- a/modules/common/options/default.nix +++ b/modules/options/default.nix @@ -19,11 +19,6 @@ type = types.enum ["desktop" "server"]; description = "The role this machine has"; }; - profiles = mkOption { - type = types.listOf (types.enum ["private" "work"]); - description = "The profiles to enable on this host"; - default = []; - }; }; user = { name = mkOption { diff --git a/modules/nixos/proxmox-vm/default.nix b/modules/proxmox-vm/default.nix similarity index 100% rename from modules/nixos/proxmox-vm/default.nix rename to modules/proxmox-vm/default.nix diff --git a/modules/nixos/sops/default.nix b/modules/sops/default.nix similarity index 100% rename from modules/nixos/sops/default.nix rename to modules/sops/default.nix diff --git a/modules/nixos/sound/default.nix b/modules/sound/default.nix similarity index 100% rename from modules/nixos/sound/default.nix rename to modules/sound/default.nix diff --git a/modules/nixos/ssh-access/default.nix b/modules/ssh-access/default.nix similarity index 100% rename from modules/nixos/ssh-access/default.nix rename to modules/ssh-access/default.nix diff --git a/modules/nixos/ssh-access/id_ed25519.pub b/modules/ssh-access/id_ed25519.pub similarity index 100% rename from modules/nixos/ssh-access/id_ed25519.pub rename to modules/ssh-access/id_ed25519.pub diff --git a/modules/nixos/sway/default.nix b/modules/sway/default.nix similarity index 100% rename from modules/nixos/sway/default.nix rename to modules/sway/default.nix diff --git a/modules/common/utilities/default.nix b/modules/utilities/default.nix similarity index 100% rename from modules/common/utilities/default.nix rename to modules/utilities/default.nix diff --git a/modules/nixos/vaultwarden/default.nix b/modules/vaultwarden/default.nix similarity index 100% rename from modules/nixos/vaultwarden/default.nix rename to modules/vaultwarden/default.nix diff --git a/systems/aarch64-darwin/WQ0C6FWJ1W/configuration.nix b/systems/aarch64-darwin/WQ0C6FWJ1W/configuration.nix deleted file mode 100644 index 05b6ea5..0000000 --- a/systems/aarch64-darwin/WQ0C6FWJ1W/configuration.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - lib, - inputs, - ... -}: { - imports = [ - ../../../modules/darwin - ]; - - my = { - host = { - role = "desktop"; - profiles = ["work"]; - }; - user = { - email = "benedikt@gradle.com"; - signingKey = "5AEF67FC9BD7F4CA"; - }; - }; - - nix.settings.experimental-features = ["nix-command" "flakes"]; - - nixpkgs = let - system = "aarch64-darwin"; - in { - hostPlatform = lib.mkDefault system; - overlays = [inputs.self.overlays.${system}]; - }; - - # Host name has to equal serial number of the machine due to company device management - networking.hostName = "WQ0C6FWJ1W"; - - # Auto upgrade nix package and the daemon service. - services.nix-daemon.enable = true; - - # Set Git commit hash for darwin-version. - # system.configurationRevision = self.rev or self.dirtyRev or null; - - # Used for backwards compatibility, please read the changelog before changing. - # $ darwin-rebuild changelog - system.stateVersion = 4; -} diff --git a/systems/aarch64-linux/directions/configuration.nix b/systems/aarch64-linux/directions/configuration.nix index 425db60..ed6d4bf 100644 --- a/systems/aarch64-linux/directions/configuration.nix +++ b/systems/aarch64-linux/directions/configuration.nix @@ -4,7 +4,7 @@ ... }: { imports = [ - ../../../modules/nixos + ../../../modules ./hardware-configuration.nix inputs.nixos-hardware.nixosModules.raspberry-pi-4 ]; diff --git a/systems/x86_64-linux/minimal-server-iso/configuration.nix b/systems/x86_64-linux/minimal-server-iso/configuration.nix index 9d4ac5d..1916c7a 100644 --- a/systems/x86_64-linux/minimal-server-iso/configuration.nix +++ b/systems/x86_64-linux/minimal-server-iso/configuration.nix @@ -7,7 +7,7 @@ }: { imports = [ "${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" - ../../../modules/nixos/homelab + ../../../modules/homelab ]; nix.settings.experimental-features = ["nix-command" "flakes"]; diff --git a/systems/x86_64-linux/pulse-14/configuration.nix b/systems/x86_64-linux/pulse-14/configuration.nix index 0682be0..c52cd41 100644 --- a/systems/x86_64-linux/pulse-14/configuration.nix +++ b/systems/x86_64-linux/pulse-14/configuration.nix @@ -6,7 +6,7 @@ }: { imports = [ inputs.nixos-facter-modules.nixosModules.facter - ../../../modules/nixos + ../../../modules ]; facter.reportPath = ./facter.json; @@ -15,7 +15,6 @@ my = { host = { role = "desktop"; - profiles = ["private"]; }; user.signingKey = "394546A47BB40E12"; modules = { diff --git a/systems/x86_64-linux/srv-eval-1/configuration.nix b/systems/x86_64-linux/srv-eval-1/configuration.nix index 4f66d3c..d7f3ad9 100644 --- a/systems/x86_64-linux/srv-eval-1/configuration.nix +++ b/systems/x86_64-linux/srv-eval-1/configuration.nix @@ -1,6 +1,6 @@ {...}: { imports = [ - ../../../modules/nixos + ../../../modules ]; my = { diff --git a/systems/x86_64-linux/srv-prod-1/configuration.nix b/systems/x86_64-linux/srv-prod-1/configuration.nix index ad13a97..a294496 100644 --- a/systems/x86_64-linux/srv-prod-1/configuration.nix +++ b/systems/x86_64-linux/srv-prod-1/configuration.nix @@ -1,6 +1,6 @@ {...}: { imports = [ - ../../../modules/nixos + ../../../modules ]; my = { diff --git a/systems/x86_64-linux/srv-prod-2/configuration.nix b/systems/x86_64-linux/srv-prod-2/configuration.nix index f102113..81cab25 100644 --- a/systems/x86_64-linux/srv-prod-2/configuration.nix +++ b/systems/x86_64-linux/srv-prod-2/configuration.nix @@ -1,6 +1,6 @@ {...}: { imports = [ - ../../../modules/nixos + ../../../modules ]; my = { diff --git a/systems/x86_64-linux/srv-test-1/configuration.nix b/systems/x86_64-linux/srv-test-1/configuration.nix index 340971d..c95c8df 100644 --- a/systems/x86_64-linux/srv-test-1/configuration.nix +++ b/systems/x86_64-linux/srv-test-1/configuration.nix @@ -1,6 +1,6 @@ {...}: { imports = [ - ../../../modules/nixos + ../../../modules ]; my = { diff --git a/systems/x86_64-linux/srv-test-2/configuration.nix b/systems/x86_64-linux/srv-test-2/configuration.nix index e271351..d636c5b 100644 --- a/systems/x86_64-linux/srv-test-2/configuration.nix +++ b/systems/x86_64-linux/srv-test-2/configuration.nix @@ -1,6 +1,6 @@ {...}: { imports = [ - ../../../modules/nixos + ../../../modules ]; my = {