1
1
Fork 0

nix: change nixpkgs-local dir

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2024-09-12 16:58:09 -05:00
parent 3a26b31226
commit d5141091bd
Signed by: myned
GPG key ID: C7224454F7881A34
2 changed files with 139 additions and 141 deletions

View file

@ -6,98 +6,95 @@
#?? nix run .#genflake flake.nix #?? nix run .#genflake flake.nix
# TODO: Remove flakegen hook when nix expressions are officially implemented # TODO: Remove flakegen hook when nix expressions are officially implemented
# https://github.com/NixOS/nix/issues/3966 # https://github.com/NixOS/nix/issues/3966
{ {
# https://wiki.nixos.org/wiki/Flakes # https://wiki.nixos.org/wiki/Flakes
# https://nix.dev/manual/nix/2.18/command-ref/new-cli/nix3-flake.html # https://nix.dev/manual/nix/2.18/command-ref/new-cli/nix3-flake.html
inputs = inputs = let
let flake = url: {inherit url;};
flake = url: { inherit url; }; follows = input: {inputs.${input}.follows = input;};
follows = input: { inputs.${input}.follows = input; }; stable = input: {inputs.${input}.follows = "${input}-stable";};
stable = input: { inputs.${input}.follows = "${input}-stable"; }; unstable = input: {inputs.${input}.follows = "${input}-unstable";};
unstable = input: { inputs.${input}.follows = "${input}-unstable"; };
source = url: { source = url: {
inherit url; inherit url;
flake = false; 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";
}; };
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: { outputs = inputs: {
# TODO: Use forAllSystems # TODO: Use forAllSystems
@ -106,35 +103,37 @@
# https://github.com/kamadorueda/alejandra/blob/main/STYLE.md # https://github.com/kamadorueda/alejandra/blob/main/STYLE.md
formatter.x86_64-linux = inputs.nixpkgs-unstable.legacyPackages.x86_64-linux.alejandra; formatter.x86_64-linux = inputs.nixpkgs-unstable.legacyPackages.x86_64-linux.alejandra;
nixosConfigurations = nixosConfigurations = let
let # TODO: Use inline modules instead of specialArgs
# TODO: Use inline modules instead of specialArgs # https://jade.fyi/blog/flakes-arent-real#nixos-modules
# https://jade.fyi/blog/flakes-arent-real#nixos-modules # Boilerplate systems with global imports
# Boilerplate systems with global imports #!! There is no default nixpkgs, inputs.<nixpkgs|home-manager>-BRANCH must exist
#!! There is no default nixpkgs, inputs.<nixpkgs|home-manager>-BRANCH must exist #?? branch = common "BRANCH" "ARCHITECTURE" [ MODULES ]
#?? branch = common "BRANCH" "ARCHITECTURE" [ MODULES ] common = branch: arch: modules:
common = inputs."nixpkgs-${branch}".lib.nixosSystem {
branch: arch: modules: system = arch;
inputs."nixpkgs-${branch}".lib.nixosSystem {
system = arch;
specialArgs = { specialArgs = {
inherit inputs; inherit inputs;
}; };
# TODO: Clean up optional attributes with each new release # TODO: Clean up optional attributes with each new release
#!! Options will diverge between branches over time #!! Options will diverge between branches over time
#?? with lib; optionalAttrs (versionAtLeast version "VERSION") { ... }; #?? with lib; optionalAttrs (versionAtLeast version "VERSION") { ... };
modules = modules ++ [ modules =
modules
++ [
./options ./options
./configuration.nix ./configuration.nix
#!! Avoid globally importing modules that are not guarded by .enable #!! Avoid globally importing modules that are not guarded by .enable
# https://github.com/NixOS/nixpkgs/issues/137168 # https://github.com/NixOS/nixpkgs/issues/137168
( (
{ config, inputs, ... }:
{ {
config,
inputs,
...
}: {
imports = [ imports = [
inputs."aagl-gtk-on-nix-${branch}".nixosModules.default inputs."aagl-gtk-on-nix-${branch}".nixosModules.default
inputs."home-manager-${branch}".nixosModules.home-manager inputs."home-manager-${branch}".nixosModules.home-manager
@ -152,44 +151,43 @@
} }
) )
]; ];
}; };
#?? system = branch "ARCHITECTURE" [ MODULES ] #?? system = branch "ARCHITECTURE" [ MODULES ]
stable = arch: modules: common "stable" "${arch}-linux" modules; stable = arch: modules: common "stable" "${arch}-linux" modules;
unstable = arch: modules: common "unstable" "${arch}-linux" modules; unstable = arch: modules: common "unstable" "${arch}-linux" modules;
in in {
{ ### Stable
### Stable myarm = stable "aarch64" [
myarm = stable "aarch64" [ ./profiles/server
./profiles/server ./machines/myarm
./machines/myarm ];
];
myne = stable "x86_64" [ myne = stable "x86_64" [
./profiles/server ./profiles/server
./machines/myne ./machines/myne
]; ];
mypi3 = stable "aarch64" [ mypi3 = stable "aarch64" [
./profiles/sbc ./profiles/sbc
./machines/mypi3 ./machines/mypi3
]; ];
### Unstable ### Unstable
myeck = unstable "x86_64" [ myeck = unstable "x86_64" [
./profiles/console ./profiles/console
./machines/myeck ./machines/myeck
]; ];
mynix = unstable "x86_64" [ mynix = unstable "x86_64" [
./profiles/desktop ./profiles/desktop
./machines/mynix ./machines/mynix
]; ];
myork = unstable "x86_64" [ myork = unstable "x86_64" [
./profiles/laptop ./profiles/laptop
./machines/myork ./machines/myork
]; ];
}; };
}; };
} }

View file

@ -113,7 +113,7 @@
url = "github:nix-community/nixd"; url = "github:nix-community/nixd";
}; };
nixos-hardware.url = "github:NixOS/nixos-hardware"; 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-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-staging-next.url = "github:NixOS/nixpkgs/staging-next"; nixpkgs-staging-next.url = "github:NixOS/nixpkgs/staging-next";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";