diff --git a/flake.in.nix b/flake.in.nix index a76279f..b325e1b 100644 --- a/flake.in.nix +++ b/flake.in.nix @@ -6,98 +6,95 @@ #?? nix run .#genflake flake.nix # TODO: Remove flakegen hook when nix expressions are officially implemented # https://github.com/NixOS/nix/issues/3966 - { # https://wiki.nixos.org/wiki/Flakes # https://nix.dev/manual/nix/2.18/command-ref/new-cli/nix3-flake.html - inputs = - let - flake = url: { inherit url; }; - follows = input: { inputs.${input}.follows = input; }; - stable = input: { inputs.${input}.follows = "${input}-stable"; }; - unstable = input: { inputs.${input}.follows = "${input}-unstable"; }; + inputs = let + flake = url: {inherit url;}; + follows = input: {inputs.${input}.follows = input;}; + stable = input: {inputs.${input}.follows = "${input}-stable";}; + unstable = input: {inputs.${input}.follows = "${input}-unstable";}; - source = url: { - inherit url; - flake = false; - }; - in - { - #?? branch = "git+https://REPO?ref=BRANCH" - #?? commit = "git+https://REPO?ref=BRANCH&rev=COMMIT" - #?? tag = "git+https://REPO?ref=refs/tags/TAG" - - ### Standalone - nixos-hardware = flake "github:NixOS/nixos-hardware"; - - ### Stable - nixpkgs-stable = flake "github:NixOS/nixpkgs/nixos-24.05"; - - # Common flakes - home-manager-stable = flake "github:nix-community/home-manager/release-24.05" // stable "nixpkgs"; - nix-index-database-stable = flake "github:nix-community/nix-index-database" // stable "nixpkgs"; - - # Desktop flakes - aagl-gtk-on-nix-stable = flake "github:ezKEa/aagl-gtk-on-nix/release-24.05" // stable "nixpkgs"; - - ### Unstable - nixpkgs-unstable = flake "github:NixOS/nixpkgs/nixos-unstable"; - - # Common flakes - agenix = flake "github:ryantm/agenix" // unstable "nixpkgs"; - arion = flake "github:hercules-ci/arion" // unstable "nixpkgs"; - compose2nix = flake "github:aksiksi/compose2nix" // unstable "nixpkgs"; - disko = flake "github:nix-community/disko" // unstable "nixpkgs"; - home-manager-unstable = flake "github:nix-community/home-manager" // unstable "nixpkgs"; - nix-index-database-unstable = flake "github:nix-community/nix-index-database" // unstable "nixpkgs"; - - # Console flakes - jovian-nixos = flake "github:Jovian-Experiments/Jovian-NixOS" // unstable "nixpkgs"; - - # Desktop flakes - aagl-gtk-on-nix-unstable = flake "github:ezKEa/aagl-gtk-on-nix" // unstable "nixpkgs"; - ags = flake "github:Aylur/ags" // unstable "nixpkgs"; - anyrun = flake "github:Kirottu/anyrun" // unstable "nixpkgs"; - bitwarden-menu = flake "github:firecat53/bitwarden-menu" // unstable "nixpkgs"; - fw-fanctrl = flake "github:TamtamHero/fw-fanctrl/packaging/nix" // unstable "nixpkgs"; - hypridle = flake "github:hyprwm/hypridle" // unstable "nixpkgs"; - #// hyprland = flake "git+https://github.com/hyprwm/Hyprland?submodules=1" // unstable "nixpkgs"; - hyprland = - flake "git+https://github.com/hyprwm/Hyprland?ref=refs/tags/v0.43.0&submodules=1" - // unstable "nixpkgs"; - #// hyprland = - #// flake "git+https://github.com/UjinT34/Hyprland?ref=vrr-cursor-fix&submodules=1" - #// // unstable "nixpkgs"; - hyprland-contrib = flake "github:hyprwm/contrib" // unstable "nixpkgs"; - hyprland-plugins = - flake "github:hyprwm/hyprland-plugins" // unstable "nixpkgs" // follows "hyprland"; - hyprlock = flake "github:hyprwm/hyprlock" // unstable "nixpkgs"; - hyprpaper = flake "github:hyprwm/hyprpaper" // unstable "nixpkgs"; - hyprpicker = flake "github:hyprwm/hyprpicker" // unstable "nixpkgs"; - nix-flatpak = flake "github:gmodena/nix-flatpak?ref=v0.4.1"; - nix-vscode-extensions = flake "github:nix-community/nix-vscode-extensions" // unstable "nixpkgs"; - nixd = flake "github:nix-community/nixd" // unstable "nixpkgs"; - xdg-desktop-portal-hyprland = - flake "github:hyprwm/xdg-desktop-portal-hyprland" - // unstable "nixpkgs"; - - # Server flakes - conduwuit = flake "github:Myned/conduwuit" // unstable "nixpkgs"; - - ### Staging - nixpkgs-staging-next = flake "github:NixOS/nixpkgs/staging-next"; - - ### Development - nixpkgs-local = flake "git+file:///home/myned/.dev/nixpkgs?ref=7849cd48822de4dc0515c787b20dc85de30acdca"; - #// hyprland = flake "git+file:///home/myned/.dev/Hyprland?submodules=1"; - - ### Source code - firefox-gnome-theme = source "github:rafaelmardojai/firefox-gnome-theme/v128"; - lifx-cli = source "github:Rawa/lifx-cli"; - steamtinkerlaunch = source "github:sonic2kk/steamtinkerlaunch"; - thunderbird-gnome-theme = source "github:rafaelmardojai/thunderbird-gnome-theme"; - virtio-win = source "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.262-2/virtio-win.iso"; + source = url: { + inherit url; + flake = false; }; + in { + #?? branch = "git+https://REPO?ref=BRANCH" + #?? commit = "git+https://REPO?ref=BRANCH&rev=COMMIT" + #?? tag = "git+https://REPO?ref=refs/tags/TAG" + + ### Standalone + nixos-hardware = flake "github:NixOS/nixos-hardware"; + + ### Stable + nixpkgs-stable = flake "github:NixOS/nixpkgs/nixos-24.05"; + + # Common flakes + home-manager-stable = flake "github:nix-community/home-manager/release-24.05" // stable "nixpkgs"; + nix-index-database-stable = flake "github:nix-community/nix-index-database" // stable "nixpkgs"; + + # Desktop flakes + aagl-gtk-on-nix-stable = flake "github:ezKEa/aagl-gtk-on-nix/release-24.05" // stable "nixpkgs"; + + ### Unstable + nixpkgs-unstable = flake "github:NixOS/nixpkgs/nixos-unstable"; + + # Common flakes + agenix = flake "github:ryantm/agenix" // unstable "nixpkgs"; + arion = flake "github:hercules-ci/arion" // unstable "nixpkgs"; + compose2nix = flake "github:aksiksi/compose2nix" // unstable "nixpkgs"; + disko = flake "github:nix-community/disko" // unstable "nixpkgs"; + home-manager-unstable = flake "github:nix-community/home-manager" // unstable "nixpkgs"; + nix-index-database-unstable = flake "github:nix-community/nix-index-database" // unstable "nixpkgs"; + + # Console flakes + jovian-nixos = flake "github:Jovian-Experiments/Jovian-NixOS" // unstable "nixpkgs"; + + # Desktop flakes + aagl-gtk-on-nix-unstable = flake "github:ezKEa/aagl-gtk-on-nix" // unstable "nixpkgs"; + ags = flake "github:Aylur/ags" // unstable "nixpkgs"; + anyrun = flake "github:Kirottu/anyrun" // unstable "nixpkgs"; + bitwarden-menu = flake "github:firecat53/bitwarden-menu" // unstable "nixpkgs"; + fw-fanctrl = flake "github:TamtamHero/fw-fanctrl/packaging/nix" // unstable "nixpkgs"; + hypridle = flake "github:hyprwm/hypridle" // unstable "nixpkgs"; + #// hyprland = flake "git+https://github.com/hyprwm/Hyprland?submodules=1" // unstable "nixpkgs"; + hyprland = + flake "git+https://github.com/hyprwm/Hyprland?ref=refs/tags/v0.43.0&submodules=1" + // unstable "nixpkgs"; + #// hyprland = + #// flake "git+https://github.com/UjinT34/Hyprland?ref=vrr-cursor-fix&submodules=1" + #// // unstable "nixpkgs"; + hyprland-contrib = flake "github:hyprwm/contrib" // unstable "nixpkgs"; + hyprland-plugins = + flake "github:hyprwm/hyprland-plugins" // unstable "nixpkgs" // follows "hyprland"; + hyprlock = flake "github:hyprwm/hyprlock" // unstable "nixpkgs"; + hyprpaper = flake "github:hyprwm/hyprpaper" // unstable "nixpkgs"; + hyprpicker = flake "github:hyprwm/hyprpicker" // unstable "nixpkgs"; + nix-flatpak = flake "github:gmodena/nix-flatpak?ref=v0.4.1"; + nix-vscode-extensions = flake "github:nix-community/nix-vscode-extensions" // unstable "nixpkgs"; + nixd = flake "github:nix-community/nixd" // unstable "nixpkgs"; + xdg-desktop-portal-hyprland = + flake "github:hyprwm/xdg-desktop-portal-hyprland" + // unstable "nixpkgs"; + + # Server flakes + conduwuit = flake "github:Myned/conduwuit" // unstable "nixpkgs"; + + ### Staging + nixpkgs-staging-next = flake "github:NixOS/nixpkgs/staging-next"; + + ### Development + nixpkgs-local = flake "git+file:///home/myned/SYNC/dev/repo/nixpkgs"; + #// hyprland = flake "git+file:///home/myned/SYNC/dev/repo/Hyprland?submodules=1"; + + ### Source code + firefox-gnome-theme = source "github:rafaelmardojai/firefox-gnome-theme/v128"; + lifx-cli = source "github:Rawa/lifx-cli"; + steamtinkerlaunch = source "github:sonic2kk/steamtinkerlaunch"; + thunderbird-gnome-theme = source "github:rafaelmardojai/thunderbird-gnome-theme"; + virtio-win = source "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.262-2/virtio-win.iso"; + }; outputs = inputs: { # TODO: Use forAllSystems @@ -106,35 +103,37 @@ # https://github.com/kamadorueda/alejandra/blob/main/STYLE.md formatter.x86_64-linux = inputs.nixpkgs-unstable.legacyPackages.x86_64-linux.alejandra; - nixosConfigurations = - let - # TODO: Use inline modules instead of specialArgs - # https://jade.fyi/blog/flakes-arent-real#nixos-modules - # Boilerplate systems with global imports - #!! There is no default nixpkgs, inputs.-BRANCH must exist - #?? branch = common "BRANCH" "ARCHITECTURE" [ MODULES ] - common = - branch: arch: modules: - inputs."nixpkgs-${branch}".lib.nixosSystem { - system = arch; + nixosConfigurations = let + # TODO: Use inline modules instead of specialArgs + # https://jade.fyi/blog/flakes-arent-real#nixos-modules + # Boilerplate systems with global imports + #!! There is no default nixpkgs, inputs.-BRANCH must exist + #?? branch = common "BRANCH" "ARCHITECTURE" [ MODULES ] + common = branch: arch: modules: + inputs."nixpkgs-${branch}".lib.nixosSystem { + system = arch; - specialArgs = { - inherit inputs; - }; + specialArgs = { + inherit inputs; + }; - # TODO: Clean up optional attributes with each new release - #!! Options will diverge between branches over time - #?? with lib; optionalAttrs (versionAtLeast version "VERSION") { ... }; - modules = modules ++ [ + # TODO: Clean up optional attributes with each new release + #!! Options will diverge between branches over time + #?? with lib; optionalAttrs (versionAtLeast version "VERSION") { ... }; + modules = + modules + ++ [ ./options ./configuration.nix #!! Avoid globally importing modules that are not guarded by .enable # https://github.com/NixOS/nixpkgs/issues/137168 ( - { config, inputs, ... }: - { + config, + inputs, + ... + }: { imports = [ inputs."aagl-gtk-on-nix-${branch}".nixosModules.default inputs."home-manager-${branch}".nixosModules.home-manager @@ -152,44 +151,43 @@ } ) ]; - }; + }; - #?? system = branch "ARCHITECTURE" [ MODULES ] - stable = arch: modules: common "stable" "${arch}-linux" modules; - unstable = arch: modules: common "unstable" "${arch}-linux" modules; - in - { - ### Stable - myarm = stable "aarch64" [ - ./profiles/server - ./machines/myarm - ]; + #?? system = branch "ARCHITECTURE" [ MODULES ] + stable = arch: modules: common "stable" "${arch}-linux" modules; + unstable = arch: modules: common "unstable" "${arch}-linux" modules; + in { + ### Stable + myarm = stable "aarch64" [ + ./profiles/server + ./machines/myarm + ]; - myne = stable "x86_64" [ - ./profiles/server - ./machines/myne - ]; + myne = stable "x86_64" [ + ./profiles/server + ./machines/myne + ]; - mypi3 = stable "aarch64" [ - ./profiles/sbc - ./machines/mypi3 - ]; + mypi3 = stable "aarch64" [ + ./profiles/sbc + ./machines/mypi3 + ]; - ### Unstable - myeck = unstable "x86_64" [ - ./profiles/console - ./machines/myeck - ]; + ### Unstable + myeck = unstable "x86_64" [ + ./profiles/console + ./machines/myeck + ]; - mynix = unstable "x86_64" [ - ./profiles/desktop - ./machines/mynix - ]; + mynix = unstable "x86_64" [ + ./profiles/desktop + ./machines/mynix + ]; - myork = unstable "x86_64" [ - ./profiles/laptop - ./machines/myork - ]; - }; + myork = unstable "x86_64" [ + ./profiles/laptop + ./machines/myork + ]; + }; }; } diff --git a/flake.nix b/flake.nix index e4a7744..52b0aaf 100644 --- a/flake.nix +++ b/flake.nix @@ -113,7 +113,7 @@ url = "github:nix-community/nixd"; }; nixos-hardware.url = "github:NixOS/nixos-hardware"; - nixpkgs-local.url = "git+file:///home/myned/.dev/nixpkgs?ref=7849cd48822de4dc0515c787b20dc85de30acdca"; + nixpkgs-local.url = "git+file:///home/myned/SYNC/dev/repo/nixpkgs"; nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05"; nixpkgs-staging-next.url = "github:NixOS/nixpkgs/staging-next"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";