refactor: flake.nix looks nicer

This commit is contained in:
Mohammad Rafiq 2025-03-26 20:40:46 +08:00
parent 65655e8391
commit 71a947e285
No known key found for this signature in database
3 changed files with 50 additions and 227 deletions

184
flake.lock generated
View file

@ -249,27 +249,6 @@
} }
}, },
"flake-parts_2": { "flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1741352980,
"narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_3": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib_2" "nixpkgs-lib": "nixpkgs-lib_2"
}, },
@ -287,7 +266,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_4": { "flake-parts_3": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"stylix", "stylix",
@ -343,24 +322,6 @@
} }
}, },
"flake-utils_2": { "flake-utils_2": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"inputs": { "inputs": {
"systems": [ "systems": [
"stylix", "stylix",
@ -381,9 +342,9 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_4": { "flake-utils_3": {
"inputs": { "inputs": {
"systems": "systems_8" "systems": "systems_7"
}, },
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1731533236,
@ -1012,34 +973,6 @@
"type": "github" "type": "github"
} }
}, },
"ixx": {
"inputs": {
"flake-utils": [
"nixvim",
"nuschtosSearch",
"flake-utils"
],
"nixpkgs": [
"nixvim",
"nuschtosSearch",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729958008,
"narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=",
"owner": "NuschtOS",
"repo": "ixx",
"rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"ref": "v0.0.6",
"repo": "ixx",
"type": "github"
}
},
"mnw": { "mnw": {
"locked": { "locked": {
"lastModified": 1742255973, "lastModified": 1742255973,
@ -1181,22 +1114,6 @@
} }
}, },
"nixpkgs_10": { "nixpkgs_10": {
"locked": {
"lastModified": 1742707865,
"narHash": "sha256-RVQQZy38O3Zb8yoRJhuFgWo/iDIDj0hEdRTVfhOtzRk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dd613136ee91f67e5dba3f3f41ac99ae89c5406b",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_11": {
"locked": { "locked": {
"lastModified": 1737003892, "lastModified": 1737003892,
"narHash": "sha256-RCzJE9wKByLCXmRBp+z8LK9EgdW+K+W/DXnJS4S/NVo=", "narHash": "sha256-RCzJE9wKByLCXmRBp+z8LK9EgdW+K+W/DXnJS4S/NVo=",
@ -1340,28 +1257,6 @@
"type": "github" "type": "github"
} }
}, },
"nixvim": {
"inputs": {
"flake-parts": "flake-parts_2",
"nixpkgs": [
"nixpkgs"
],
"nuschtosSearch": "nuschtosSearch"
},
"locked": {
"lastModified": 1742559284,
"narHash": "sha256-PSSjCCqpJPkCagkkdLODBVVonGxgwU5dN2CYlFPNVNw=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "c980271267ef146a6c30394c611a97e077471cf2",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixvim",
"type": "github"
}
},
"nmd": { "nmd": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -1380,7 +1275,7 @@
}, },
"nur": { "nur": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_4", "flake-parts": "flake-parts_3",
"nixpkgs": [ "nixpkgs": [
"stylix", "stylix",
"nixpkgs" "nixpkgs"
@ -1401,38 +1296,15 @@
"type": "github" "type": "github"
} }
}, },
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils",
"ixx": "ixx",
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1741886583,
"narHash": "sha256-sScfYKtxp3CYv5fJcHQDvQjqBL+tPNQqS9yf9Putd+s=",
"owner": "NuschtOS",
"repo": "search",
"rev": "2974bc5fa3441a319fba943f3ca41f7dcd1a1467",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"repo": "search",
"type": "github"
}
},
"nvf": { "nvf": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_3", "flake-parts": "flake-parts_2",
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils",
"mnw": "mnw", "mnw": "mnw",
"nil": "nil", "nil": "nil",
"nixpkgs": "nixpkgs_6", "nixpkgs": "nixpkgs_6",
"nmd": "nmd", "nmd": "nmd",
"systems": "systems_5" "systems": "systems_4"
}, },
"locked": { "locked": {
"lastModified": 1742471089, "lastModified": 1742471089,
@ -1487,12 +1359,10 @@
"nixd": "nixd", "nixd": "nixd",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_5",
"nixvim": "nixvim",
"nvf": "nvf", "nvf": "nvf",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"spicetify-nix": "spicetify-nix", "spicetify-nix": "spicetify-nix",
"stylix": "stylix", "stylix": "stylix",
"wii-cursor": "wii-cursor",
"yazi": "yazi" "yazi": "yazi"
} }
}, },
@ -1560,7 +1430,7 @@
"spicetify-nix": { "spicetify-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_8", "nixpkgs": "nixpkgs_8",
"systems": "systems_6" "systems": "systems_5"
}, },
"locked": { "locked": {
"lastModified": 1742512598, "lastModified": 1742512598,
@ -1584,13 +1454,13 @@
"base16-vim": "base16-vim", "base16-vim": "base16-vim",
"firefox-gnome-theme": "firefox-gnome-theme", "firefox-gnome-theme": "firefox-gnome-theme",
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_2",
"git-hooks": "git-hooks", "git-hooks": "git-hooks",
"gnome-shell": "gnome-shell", "gnome-shell": "gnome-shell",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"nixpkgs": "nixpkgs_9", "nixpkgs": "nixpkgs_9",
"nur": "nur", "nur": "nur",
"systems": "systems_7", "systems": "systems_6",
"tinted-foot": "tinted-foot", "tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty", "tinted-kitty": "tinted-kitty",
"tinted-schemes": "tinted-schemes", "tinted-schemes": "tinted-schemes",
@ -1716,21 +1586,6 @@
"type": "github" "type": "github"
} }
}, },
"systems_8": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tinted-foot": { "tinted-foot": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -1856,21 +1711,6 @@
"type": "github" "type": "github"
} }
}, },
"wii-cursor": {
"inputs": {
"nixpkgs": "nixpkgs_10"
},
"locked": {
"lastModified": 1742819018,
"narHash": "sha256-B2HXOJxQgQVPiXkPCONP6d/SPaYYCz17iGABzPAfCIs=",
"path": "/home/rafiq/repos/dotfiles/media/wii-cursors-xcursor",
"type": "path"
},
"original": {
"path": "/home/rafiq/repos/dotfiles/media/wii-cursors-xcursor",
"type": "path"
}
},
"xdph": { "xdph": {
"inputs": { "inputs": {
"hyprland-protocols": [ "hyprland-protocols": [
@ -1914,8 +1754,8 @@
}, },
"yazi": { "yazi": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_11", "nixpkgs": "nixpkgs_10",
"rust-overlay": "rust-overlay_2" "rust-overlay": "rust-overlay_2"
}, },
"locked": { "locked": {

View file

@ -1,38 +1,22 @@
{ {
description = "flake forward setup with two hosts on different architectures";
outputs = outputs =
{ {
self, self,
nixpkgs,
home-manager,
... ...
}@inputs: }@inputs:
let let
forEachSupportedSystem = mkSystem = type: hostname: {
f: name = "${hostname}";
nixpkgs.lib.genAttrs value =
[ let
"x86_64-linux" args = { inherit self inputs type; };
"aarch64-linux" in
"x86_64-darwin" inputs.nixpkgs.lib.nixosSystem {
"aarch64-darwin"
]
(
system:
f {
pkgs = import nixpkgs { inherit system; };
}
);
args = { inherit self inputs; };
mkSystem =
hostname:
nixpkgs.lib.nixosSystem {
specialArgs = args; specialArgs = args;
modules = [ modules = [
./systems/${hostname}.nix ./systems/${hostname}.nix
home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
{ {
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
@ -45,29 +29,28 @@
} }
]; ];
}; };
mkListItem = hostname: {
name = "${hostname}";
value = mkSystem "${hostname}";
}; };
in in
{ {
# System Configurations # System Configurations
nixosConfigurations = builtins.listToAttrs [ nixosConfigurations = builtins.listToAttrs [
(mkListItem "nemesis") (mkSystem "desktop" "nemesis")
(mkListItem "mellinoe") (mkSystem "desktop" "mellinoe")
]; ];
}; };
inputs = { inputs = {
hyprland-plugins.inputs.hyprland.follows = "hyprland"; ags.inputs.nixpkgs.follows = "nixpkgs";
hyprland-plugins.url = "github:hyprwm/hyprland-plugins"; ags.url = "github:aylur/ags";
wii-cursor.path = "/home/rafiq/repos/dotfiles/media/wii-cursors-xcursor"; astal.inputs.nixpkgs.follows = "nixpkgs";
wii-cursor.type = "path"; astal.url = "github:aylur/astal";
disko.inputs.nixpkgs.follows = "nixpkgs"; disko.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko/latest"; disko.url = "github:nix-community/disko/latest";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
hyprcloser.url = "github:rrvsh/hyprcloser"; hyprcloser.url = "github:rrvsh/hyprcloser";
hyprland-plugins.inputs.hyprland.follows = "hyprland";
hyprland-plugins.url = "github:hyprwm/hyprland-plugins";
hyprland.url = "github:hyprwm/Hyprland"; hyprland.url = "github:hyprwm/Hyprland";
hyprlock.url = "github:hyprwm/hyprlock"; hyprlock.url = "github:hyprwm/hyprlock";
hyprshaders.flake = false; hyprshaders.flake = false;
@ -78,16 +61,10 @@
nixd.url = "github:nix-community/nixd"; nixd.url = "github:nix-community/nixd";
nixos-hardware.url = "github:nixos/nixos-hardware"; nixos-hardware.url = "github:nixos/nixos-hardware";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixvim.inputs.nixpkgs.follows = "nixpkgs";
nixvim.url = "github:nix-community/nixvim";
nvf.url = "github:notashelf/nvf"; nvf.url = "github:notashelf/nvf";
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
spicetify-nix.url = "github:Gerg-L/spicetify-nix"; spicetify-nix.url = "github:Gerg-L/spicetify-nix";
stylix.url = "github:danth/stylix"; stylix.url = "github:danth/stylix";
yazi.url = "github:sxyazi/yazi"; yazi.url = "github:sxyazi/yazi";
astal.url = "github:aylur/astal";
astal.inputs.nixpkgs.follows = "nixpkgs";
ags.url = "github:aylur/ags";
ags.inputs.nixpkgs.follows = "nixpkgs";
}; };
} }

View file

@ -1,4 +1,9 @@
{ pkgs, osConfig, ... }: {
pkgs,
osConfig,
type,
...
}:
{ {
programs.zsh = { programs.zsh = {
enable = true; enable = true;
@ -14,6 +19,7 @@
bindkey '^H' backward-kill-word bindkey '^H' backward-kill-word
# Set Cargo Registry Token # Set Cargo Registry Token
export CARGO_REGISTRY_TOKEN="$(cat ${osConfig.sops.secrets.cargo_api_key.path})" export CARGO_REGISTRY_TOKEN="$(cat ${osConfig.sops.secrets.cargo_api_key.path})"
export SYSTEM_TYPE="${type}"
''; '';
# TODO: Look into whether we need to add the history attribute # TODO: Look into whether we need to add the history attribute
profileExtra = # bash profileExtra = # bash