refactor: use genflake for better flake inputs handling
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-05-20 01:17:07 -04:00
parent 684b8a5c9e
commit 5f9dca81e1
12 changed files with 1000 additions and 697 deletions

View file

@ -49,7 +49,10 @@ sudo ln -sf /home/matt/.nix /etc/nixos
### Flake Inputs
I prefer using a more descriptive format for my inputs like so:
To allow use of the nix language for my inputs, I use [genflake](https://github.com/jorsn/flakegen).
Therefore, the flake I edit is located at `./flake.in.nix`.
I also prefer using a more descriptive format for my inputs like so:
```nix
nixpkgs = {
@ -67,11 +70,6 @@ nixpkgs = {
to make it more clear what is what in the flake URI
I also have a long list of inputs with `flake = false;` because
it makes it easier to update non-flake custom packages or overlays
to have the latest git. I make sure to end the names of these inputs
with `src` to make it clear what they are.
### Secrets
All my secrets are in a private git repo that makes use of

View file

@ -52,6 +52,7 @@ in
*/
''
require('lspconfig').nixd.setup(require('coq').lsp_ensure_capabilities({
filetypes = { 'nix', 'in.nix' },
settings = {
nixd = {
formatting = {

View file

@ -1,7 +1,7 @@
{
bat-theme-src,
gtk-theme-src,
xresources-theme-src,
xresources-src,
...
} @ inputs: (final: prev: {
dracula-theme = prev.dracula-theme.overrideAttrs (oldAttrs: let
@ -21,7 +21,7 @@
cp -a ${bat-theme-src}/Dracula.tmTheme $out/bat
cp -a ${git-colors}/git-colors $out/git-colors
cp -a ${plymouth}/share/plymouth/themes/dracula $out/share/plymouth/themes/
cp -a ${xresources-theme-src}/Xresources $out/xres
cp -a ${xresources-src}/Xresources $out/xres
# -------------------------------------------
mkdir -p $out/share/themes/Dracula

View file

@ -1,13 +1,13 @@
{
stdenv,
plymouth-theme-src,
dracula-plymouth-src,
...
}:
stdenv.mkDerivation {
name = "dracula-plymouth";
version = plymouth-theme-src.shortRev;
version = dracula-plymouth-src.shortRev;
src = plymouth-theme-src;
src = dracula-plymouth-src;
installPhase = ''
chmod 777 ./dracula

View file

@ -1,8 +1,10 @@
{
home-manager,
nix-on-droid,
nixpkgs,
...
} @ inputs: rec {
} @ inputs:
nix-on-droid.lib.nixOnDroidConfiguration rec {
extraSpecialArgs = inputs;
home-manager-path = home-manager.outPath;
pkgs = import nixpkgs {

153
flake.in.nix Normal file
View file

@ -0,0 +1,153 @@
{
inputs = let
inherit (import ./input.nix) mkDep mkInput otherInputs;
mainInputs = {
nixpkgs = mkInput {
owner = "NixOS";
repo = "nixpkgs";
ref = "nixos-unstable";
};
home-manager = mkDep {
owner = "nix-community";
repo = "home-manager";
};
nix-on-droid = mkDep {
owner = "nix-community";
repo = "nix-on-droid";
inputs.home-manager.follows = "home-manager";
};
sops-nix = mkDep {
owner = "Mic92";
repo = "sops-nix";
};
secrets = mkDep {
type = "git";
url = "ssh://git@git.nelim.org/matt1432/nixos-secrets";
inputs.sops-nix.follows = "sops-nix";
};
};
in
mainInputs // otherInputs;
outputs = inputs @ {
self,
nixpkgs,
secrets,
...
}: let
supportedSystems = ["x86_64-linux" "aarch64-linux"];
perSystem = attrs:
nixpkgs.lib.genAttrs supportedSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in
attrs system pkgs);
# Default system
mkNixOS = mods:
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = inputs;
modules =
[
{home-manager.extraSpecialArgs = inputs;}
./common
]
++ mods;
};
in {
nixosConfigurations = {
wim = mkNixOS [
./devices/wim
secrets.nixosModules.default
];
binto = mkNixOS [./devices/binto];
nos = mkNixOS [
./devices/nos
secrets.nixosModules.nos
];
servivi = mkNixOS [
./devices/servivi
secrets.nixosModules.servivi
];
# Cluster
thingone = mkNixOS [
(import ./devices/cluster "thingone")
secrets.nixosModules.thingy
];
thingtwo = mkNixOS [
(import ./devices/cluster "thingtwo")
secrets.nixosModules.thingy
];
live-image = mkNixOS [
("${nixpkgs}/nixos/modules/installer/"
+ "cd-dvd/installation-cd-minimal.nix")
{home-manager.users.nixos.home.stateVersion = "24.05";}
{
vars = {
mainUser = "nixos";
hostName = "nixos";
};
}
];
};
nixOnDroidConfigurations.default = import ./devices/android inputs;
formatter = perSystem (_: pkgs: pkgs.alejandra);
# CI: https://github.com/Mic92/dotfiles/blob/c2f538934d67417941f83d8bb65b8263c43d32ca/flake.nix#L168
checks = perSystem (system: pkgs: let
inherit (pkgs.lib) filterAttrs mapAttrs' nameValuePair;
nixosMachines = mapAttrs' (
name: config: nameValuePair "nixos-${name}" config.config.system.build.toplevel
) ((filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations);
devShells = mapAttrs' (n: nameValuePair "devShell-${n}") self.devShells;
in
nixosMachines // devShells);
devShells = perSystem (_: pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
alejandra
git
(writeShellScriptBin "mkIso" (lib.concatStrings [
"nix build $(realpath /etc/nixos)#nixosConfigurations."
"live-image.config.system.build.isoImage"
]))
];
};
ags = pkgs.mkShell {
packages = with pkgs; [
nodejs_latest
];
};
subtitles-dev = pkgs.mkShell {
packages = with pkgs;
[
nodejs_latest
ffmpeg-full
typescript
]
++ (with nodePackages; [
ts-node
]);
};
});
};
}

View file

@ -171,6 +171,22 @@
"type": "github"
}
},
"dracula-plymouth-src": {
"flake": false,
"locked": {
"lastModified": 1704576657,
"narHash": "sha256-nHirp6UMvBd4rMpXu5xWtBf9GN/jasHhZrUol6HGXpA=",
"owner": "matt1432",
"repo": "dracula-plymouth",
"rev": "54c523dbae26bf68683f27cda79c92da87229ab0",
"type": "github"
},
"original": {
"owner": "matt1432",
"repo": "dracula-plymouth",
"type": "github"
}
},
"eisa-scripts-src": {
"flake": false,
"locked": {
@ -433,7 +449,7 @@
},
"flake-utils": {
"inputs": {
"systems": "systems_2"
"systems": "systems_3"
},
"locked": {
"lastModified": 1710146030,
@ -451,7 +467,7 @@
},
"flake-utils_2": {
"inputs": {
"systems": "systems_6"
"systems": "systems_7"
},
"locked": {
"lastModified": 1710146030,
@ -469,7 +485,7 @@
},
"flake-utils_3": {
"inputs": {
"systems": "systems_7"
"systems": "systems_8"
},
"locked": {
"lastModified": 1710146030,
@ -485,6 +501,24 @@
"type": "github"
}
},
"flakegen": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1707120544,
"narHash": "sha256-pXwH9NLXjhjnaz1n7w5m36gVUZ1GVkvtltsLnvVPFJY=",
"owner": "jorsn",
"repo": "flakegen",
"rev": "8b11749b0724700273462a674dd16e5549fe2790",
"type": "github"
},
"original": {
"owner": "jorsn",
"repo": "flakegen",
"type": "github"
}
},
"git-theme-src": {
"flake": false,
"locked": {
@ -522,7 +556,7 @@
"nixpkgs": [
"nixpkgs"
],
"systems": "systems"
"systems": "systems_2"
},
"locked": {
"lastModified": 1715315063,
@ -676,6 +710,27 @@
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"nix-on-droid",
"nixpkgs"
]
},
"locked": {
"lastModified": 1715930644,
"narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"hypr-official-plugins": {
"inputs": {
"hyprland": [
@ -736,7 +791,7 @@
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_4"
"systems": "systems_5"
},
"locked": {
"lastModified": 1715699575,
@ -760,7 +815,7 @@
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_5",
"systems": "systems_6",
"xdph": "xdph"
},
"locked": {
@ -812,7 +867,7 @@
"hypridle",
"nixpkgs"
],
"systems": "systems_3"
"systems": "systems_4"
},
"locked": {
"lastModified": 1713121246,
@ -1019,6 +1074,54 @@
"type": "github"
}
},
"mpv-persist-properties-src": {
"flake": false,
"locked": {
"lastModified": 1668485020,
"narHash": "sha256-C2nejhkxAZgfKRl9FrZZqODq2xW6zCbv/sBiqXSAd2k=",
"owner": "d87",
"repo": "mpv-persist-properties",
"rev": "ddb1e6bd7a7d57da9b567ea8dc5227906f416ec6",
"type": "github"
},
"original": {
"owner": "d87",
"repo": "mpv-persist-properties",
"type": "github"
}
},
"mpv-pointer-event-src": {
"flake": false,
"locked": {
"lastModified": 1675462432,
"narHash": "sha256-h2E8wiQX2Vh9qyi2VsXzeOE5vnD9Xin5HZ2Wu2LZUOY=",
"owner": "christoph-heinrich",
"repo": "mpv-pointer-event",
"rev": "33c5ede5977817596ace5a9942a8c801ad3b3d28",
"type": "github"
},
"original": {
"owner": "christoph-heinrich",
"repo": "mpv-pointer-event",
"type": "github"
}
},
"mpv-touch-gestures-src": {
"flake": false,
"locked": {
"lastModified": 1675464086,
"narHash": "sha256-gmo6sTwN85WS/+wtlylfI22LxyZH48DvXYP5JGCnyU4=",
"owner": "christoph-heinrich",
"repo": "mpv-touch-gestures",
"rev": "f4aa499f038997c1824ff3bfa64ee1d5438d72f2",
"type": "github"
},
"original": {
"owner": "christoph-heinrich",
"repo": "mpv-touch-gestures",
"type": "github"
}
},
"neovim-flake": {
"inputs": {
"flake-utils": "flake-utils_2",
@ -1275,9 +1378,7 @@
},
"nix-on-droid": {
"inputs": {
"home-manager": [
"home-manager"
],
"home-manager": "home-manager_2",
"nix-formatter-pack": "nix-formatter-pack",
"nixpkgs": [
"nixpkgs"
@ -1457,6 +1558,22 @@
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1716061101,
"narHash": "sha256-H0eCta7ahEgloGIwE/ihkyGstOGu+kQwAiHvwVoXaA0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e7cc61784ddf51c81487637b3031a6dd2d6673a2",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-wayland": {
"inputs": {
"flake-compat": "flake-compat_2",
@ -1478,22 +1595,6 @@
"type": "github"
}
},
"nixpkgs_10": {
"locked": {
"lastModified": 1714906307,
"narHash": "sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "25865a40d14b3f9cf19f19b924e2ab4069b09588",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1714409183,
@ -1698,11 +1799,11 @@
},
"nur": {
"locked": {
"lastModified": 1716140745,
"narHash": "sha256-ybXfvdAggMnp/X+pj8jT7C5aQ6AtL/pA9sJA/ZzAg7E=",
"lastModified": 1716149933,
"narHash": "sha256-0Ui2HmmKvSqxXfT5kCzTu2EO+kqYxavPZHROxQLsI14=",
"owner": "nix-community",
"repo": "NUR",
"rev": "49682cc18a65cd7a7e0081e9a1464b11655d4d15",
"rev": "0d0e224fe23a49977d871ae2fe2f14c84b03322a",
"type": "github"
},
"original": {
@ -1795,7 +1896,9 @@
},
"pcsd": {
"inputs": {
"nixpkgs": "nixpkgs_10",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-pacemaker": "nixpkgs-pacemaker",
"pcs-src": "pcs-src",
"pcs-web-ui-src": "pcs-web-ui-src",
@ -1815,22 +1918,6 @@
"type": "github"
}
},
"persist-properties-src": {
"flake": false,
"locked": {
"lastModified": 1668485020,
"narHash": "sha256-C2nejhkxAZgfKRl9FrZZqODq2xW6zCbv/sBiqXSAd2k=",
"owner": "d87",
"repo": "mpv-persist-properties",
"rev": "ddb1e6bd7a7d57da9b567ea8dc5227906f416ec6",
"type": "github"
},
"original": {
"owner": "d87",
"repo": "mpv-persist-properties",
"type": "github"
}
},
"piper-src": {
"flake": false,
"locked": {
@ -1847,22 +1934,6 @@
"type": "github"
}
},
"plymouth-theme-src": {
"flake": false,
"locked": {
"lastModified": 1704576657,
"narHash": "sha256-nHirp6UMvBd4rMpXu5xWtBf9GN/jasHhZrUol6HGXpA=",
"owner": "matt1432",
"repo": "dracula-plymouth",
"rev": "54c523dbae26bf68683f27cda79c92da87229ab0",
"type": "github"
},
"original": {
"owner": "matt1432",
"repo": "dracula-plymouth",
"type": "github"
}
},
"pocketsphinx-src": {
"flake": false,
"locked": {
@ -1880,22 +1951,6 @@
"type": "github"
}
},
"pointer-event-src": {
"flake": false,
"locked": {
"lastModified": 1675462432,
"narHash": "sha256-h2E8wiQX2Vh9qyi2VsXzeOE5vnD9Xin5HZ2Wu2LZUOY=",
"owner": "christoph-heinrich",
"repo": "mpv-pointer-event",
"rev": "33c5ede5977817596ace5a9942a8c801ad3b3d28",
"type": "github"
},
"original": {
"owner": "christoph-heinrich",
"repo": "mpv-pointer-event",
"type": "github"
}
},
"pokemon-colorscripts-src": {
"flake": false,
"locked": {
@ -1940,8 +1995,10 @@
"bazarr-bulk": "bazarr-bulk",
"caddy-plugins": "caddy-plugins",
"curseforge-server-downloader-src": "curseforge-server-downloader-src",
"dracula-plymouth-src": "dracula-plymouth-src",
"eisa-scripts-src": "eisa-scripts-src",
"firefox-gx-src": "firefox-gx-src",
"flakegen": "flakegen",
"git-theme-src": "git-theme-src",
"gpu-screen-recorder-src": "gpu-screen-recorder-src",
"grim-hyprland": "grim-hyprland",
@ -1956,6 +2013,9 @@
"jellyfin-ultrachromic-src": "jellyfin-ultrachromic-src",
"libratbag-src": "libratbag-src",
"modernx-src": "modernx-src",
"mpv-persist-properties-src": "mpv-persist-properties-src",
"mpv-pointer-event-src": "mpv-pointer-event-src",
"mpv-touch-gestures-src": "mpv-touch-gestures-src",
"neovim-nightly": "neovim-nightly",
"nh": "nh",
"nix-eval-jobs": "nix-eval-jobs",
@ -1973,21 +2033,17 @@
"nvim-theme-src": "nvim-theme-src",
"pam-fprint-grosshack-src": "pam-fprint-grosshack-src",
"pcsd": "pcsd",
"persist-properties-src": "persist-properties-src",
"piper-src": "piper-src",
"plymouth-theme-src": "plymouth-theme-src",
"pointer-event-src": "pointer-event-src",
"pokemon-colorscripts-src": "pokemon-colorscripts-src",
"secrets": "secrets",
"sops-nix": "sops-nix",
"sops-nix": "sops-nix_2",
"stylelint-lsp": "stylelint-lsp",
"subsync": "subsync",
"touch-gestures-src": "touch-gestures-src",
"trash-d-src": "trash-d-src",
"vimplugin-easytables-src": "vimplugin-easytables-src",
"vimplugin-ts-error-translator-src": "vimplugin-ts-error-translator-src",
"wpaperd": "wpaperd",
"xresources-theme-src": "xresources-theme-src"
"xresources-src": "xresources-src"
}
},
"scss-reset": {
@ -2011,9 +2067,7 @@
"nixpkgs": [
"nixpkgs"
],
"sops-nix": [
"sops-nix"
]
"sops-nix": "sops-nix"
},
"locked": {
"lastModified": 1716069733,
@ -2032,6 +2086,7 @@
"sops-nix": {
"inputs": {
"nixpkgs": [
"secrets",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
@ -2050,6 +2105,27 @@
"type": "github"
}
},
"sops-nix_2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1716087663,
"narHash": "sha256-zuSAGlx8Qk0OILGCC2GUyZ58/SJ5R3GZdeUNQ6IS0fQ=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "0bf1808e70ce80046b0cff821c019df2b19aabf5",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
},
"sphinxbase-src": {
"flake": false,
"locked": {
@ -2111,21 +2187,6 @@
}
},
"systems": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -2140,7 +2201,7 @@
"type": "github"
}
},
"systems_3": {
"systems_2": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
@ -2155,6 +2216,21 @@
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_4": {
"locked": {
"lastModified": 1689347949,
@ -2187,16 +2263,16 @@
},
"systems_6": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"repo": "default-linux",
"type": "github"
}
},
@ -2216,6 +2292,21 @@
}
},
"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"
}
},
"systems_9": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
@ -2230,22 +2321,6 @@
"type": "github"
}
},
"touch-gestures-src": {
"flake": false,
"locked": {
"lastModified": 1675464086,
"narHash": "sha256-gmo6sTwN85WS/+wtlylfI22LxyZH48DvXYP5JGCnyU4=",
"owner": "christoph-heinrich",
"repo": "mpv-touch-gestures",
"rev": "f4aa499f038997c1824ff3bfa64ee1d5438d72f2",
"type": "github"
},
"original": {
"owner": "christoph-heinrich",
"repo": "mpv-touch-gestures",
"type": "github"
}
},
"trash-d-src": {
"flake": false,
"locked": {
@ -2363,7 +2438,7 @@
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_8"
"systems": "systems_9"
},
"locked": {
"lastModified": 1714464091,
@ -2409,7 +2484,7 @@
"type": "github"
}
},
"xresources-theme-src": {
"xresources-src": {
"flake": false,
"locked": {
"lastModified": 1647833631,

855
flake.nix
View file

@ -1,584 +1,339 @@
# Do not modify! This file is generated.
{
outputs = inputs @ {
self,
nixpkgs,
nix-on-droid,
secrets,
...
}: let
supportedSystems = ["x86_64-linux" "aarch64-linux"];
perSystem = attrs:
nixpkgs.lib.genAttrs supportedSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in
attrs system pkgs);
# Default system
mkNixOS = mods:
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = inputs;
modules =
[
{home-manager.extraSpecialArgs = inputs;}
./common
]
++ mods;
};
# Nix-On-Droid
inherit (nix-on-droid.lib) nixOnDroidConfiguration;
in {
nixosConfigurations = {
wim = mkNixOS [
./devices/wim
secrets.nixosModules.default
];
binto = mkNixOS [./devices/binto];
nos = mkNixOS [
./devices/nos
secrets.nixosModules.nos
];
servivi = mkNixOS [
./devices/servivi
secrets.nixosModules.servivi
];
# Cluster
thingone = mkNixOS [
(import ./devices/cluster "thingone")
secrets.nixosModules.thingy
];
thingtwo = mkNixOS [
(import ./devices/cluster "thingtwo")
secrets.nixosModules.thingy
];
live-image = mkNixOS [
("${nixpkgs}/nixos/modules/installer/"
+ "cd-dvd/installation-cd-minimal.nix")
{home-manager.users.nixos.home.stateVersion = "24.05";}
{
vars = {
mainUser = "nixos";
hostName = "nixos";
};
}
];
};
nixOnDroidConfigurations.default = nixOnDroidConfiguration (
import ./devices/android inputs
);
formatter = perSystem (_: pkgs: pkgs.alejandra);
# CI: https://github.com/Mic92/dotfiles/blob/c2f538934d67417941f83d8bb65b8263c43d32ca/flake.nix#L168
checks = perSystem (system: pkgs: let
inherit (pkgs.lib) filterAttrs mapAttrs' nameValuePair;
nixosMachines = mapAttrs' (
name: config: nameValuePair "nixos-${name}" config.config.system.build.toplevel
) ((filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations);
devShells = mapAttrs' (n: nameValuePair "devShell-${n}") self.devShells;
in
nixosMachines // devShells);
devShells = perSystem (_: pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
alejandra
git
(writeShellScriptBin "mkIso" (lib.concatStrings [
"nix build $(realpath /etc/nixos)#nixosConfigurations."
"live-image.config.system.build.isoImage"
]))
];
};
ags = pkgs.mkShell {
packages = with pkgs; [
nodejs_latest
];
};
subtitles-dev = pkgs.mkShell {
packages = with pkgs;
[
nodejs_latest
ffmpeg-full
typescript
]
++ (with nodePackages; [
ts-node
]);
};
});
};
inputs = {
# Main inputs
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "nixos-unstable";
};
home-manager = {
type = "github";
owner = "nix-community";
repo = "home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-on-droid = {
type = "github";
owner = "nix-community";
repo = "nix-on-droid";
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
};
};
sops-nix = {
type = "github";
owner = "Mic92";
repo = "sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
secrets = {
type = "git";
url = "ssh://git@git.nelim.org/matt1432/nixos-secrets";
inputs = {
nixpkgs.follows = "nixpkgs";
sops-nix.follows = "sops-nix";
};
};
#
# Overlays
nixpkgs-wayland = {
type = "github";
owner = "nix-community";
repo = "nixpkgs-wayland";
};
nur = {
type = "github";
owner = "nix-community";
repo = "NUR";
};
nix-gaming = {
type = "github";
owner = "fufexan";
repo = "nix-gaming";
};
#
# Cluster Inputs
pcsd = {
type = "github";
owner = "matt1432";
repo = "nixos-pcsd";
};
headscale = {
type = "github";
owner = "juanfont";
repo = "headscale";
# FIXME: doesn't work on latest
rev = "fef8261339899fe526777a7aa42df57ca02021c5";
inputs.nixpkgs.follows = "nixpkgs";
};
caddy-plugins = {
type = "github";
owner = "matt1432";
repo = "nixos-caddy-cloudflare";
inputs.nixpkgs.follows = "nixpkgs";
};
#
# Servivi inputs
nms = {
type = "github";
owner = "matt1432";
repo = "nixos-minecraft-servers";
inputs.nixpkgs.follows = "nixpkgs";
};
#
# Nos inputs
arion = {
type = "github";
owner = "hercules-ci";
repo = "arion";
inputs.nixpkgs.follows = "nixpkgs";
};
jellyfin-flake = {
type = "github";
owner = "matt1432";
repo = "nixos-jellyfin";
inputs.nixpkgs.follows = "nixpkgs";
};
bazarr-bulk = {
type = "github";
owner = "matt1432";
repo = "bazarr-bulk";
inputs.nixpkgs.follows = "nixpkgs";
};
subsync = {
type = "github";
owner = "matt1432";
repo = "subsync";
# Keep version that uses Sphinxbase
rev = "ee9e1592ae4ec7c694d8857aa72be079d81ea209";
inputs.nixpkgs.follows = "nixpkgs";
};
#
# Desktop inputs
## Hyprland
hyprland = {
type = "git";
url = "https://github.com/hyprwm/Hyprland";
submodules = true;
inputs.nixpkgs.follows = "nixpkgs";
};
hypr-official-plugins = {
type = "github";
owner = "hyprwm";
repo = "hyprland-plugins";
inputs.hyprland.follows = "hyprland";
};
Hyprspace = {
type = "github";
inputs.hyprland.follows = "hyprland";
owner = "KZDKM";
repo = "Hyprspace";
inputs.hyprland.follows = "hyprland";
};
hypridle = {
type = "github";
owner = "hyprwm";
repo = "hypridle";
inputs.nixpkgs.follows = "nixpkgs";
};
grim-hyprland = {
type = "github";
owner = "eriedaberrie";
repo = "grim-hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
##
## Wayland
wpaperd = {
type = "github";
owner = "danyspin97";
repo = "wpaperd";
inputs.nixpkgs.follows = "nixpkgs";
};
##
## AGS
ags = {
type = "github";
inputs.nixpkgs.follows = "nixpkgs";
owner = "Aylur";
repo = "ags";
inputs.nixpkgs.follows = "nixpkgs";
};
astal = {
type = "github";
};
arion = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "hercules-ci";
repo = "arion";
type = "github";
};
astal = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "Aylur";
repo = "Astal";
inputs.nixpkgs.follows = "nixpkgs";
};
gtk-session-lock = {
type = "github";
owner = "Cu3PO42";
repo = "gtk-session-lock";
inputs.nixpkgs.follows = "nixpkgs";
};
##
#
# Neovim inputs
neovim-nightly = {
type = "github";
owner = "nix-community";
repo = "neovim-nightly-overlay";
# FIXME: issue with grammars on latest unstable
# inputs.nixpkgs.follows = "nixpkgs";
};
## LSPs
stylelint-lsp = {
type = "github";
owner = "matt1432";
repo = "stylelint-lsp";
inputs.nixpkgs.follows = "nixpkgs";
};
nixd = {
type = "github";
owner = "nix-community";
repo = "nixd";
};
# FIXME: get it from nixpkgs when it gets merged
basedpyright.url = "github:kiike/nixpkgs/pkgs/basedpyright";
## Plugin sources
vimplugin-easytables-src = {
type = "github";
owner = "Myzel394";
repo = "easytables.nvim";
flake = false;
};
vimplugin-ts-error-translator-src = {
type = "github";
owner = "dmmulroy";
repo = "ts-error-translator.nvim";
flake = false;
};
#
# Nix tools
nurl = {
type = "github";
owner = "nix-community";
repo = "nurl";
};
nix-index-db = {
type = "github";
owner = "Mic92";
repo = "nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nh = {
type = "github";
owner = "viperML";
repo = "nh";
};
nix-melt = {
type = "github";
owner = "nix-community";
repo = "nix-melt";
};
nix-eval-jobs = {
type = "github";
owner = "nix-community";
repo = "nix-eval-jobs";
ref = "release-2.21";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-fast-build = {
type = "github";
owner = "Mic92";
repo = "nix-fast-build";
inputs.nixpkgs.follows = "nixpkgs";
};
#
# -= Non-flake inputs =-
## Custom packages
trash-d-src = {
type = "github";
owner = "rushsteve1";
repo = "trash-d";
flake = false;
};
pam-fprint-grosshack-src = {
type = "gitlab";
owner = "mishakmak";
repo = "pam-fprint-grosshack";
flake = false;
};
pokemon-colorscripts-src = {
type = "gitlab";
owner = "phoneybadger";
repo = "pokemon-colorscripts";
flake = false;
};
curseforge-server-downloader-src = {
type = "github";
owner = "Malpiszonekx4";
repo = "curseforge-server-downloader";
flake = false;
};
##
## Overlays
gpu-screen-recorder-src = {
type = "git";
url = "https://repo.dec05eba.com/gpu-screen-recorder";
flake = false;
};
libratbag-src = {
type = "github";
owner = "libratbag";
repo = "libratbag";
flake = false;
};
piper-src = {
type = "github";
owner = "libratbag";
repo = "piper";
flake = false;
};
##
## MPV scripts
modernx-src = {
type = "github";
owner = "cyl0";
repo = "ModernX";
flake = false;
};
persist-properties-src = {
type = "github";
owner = "d87";
repo = "mpv-persist-properties";
flake = false;
};
pointer-event-src = {
type = "github";
owner = "christoph-heinrich";
repo = "mpv-pointer-event";
flake = false;
};
touch-gestures-src = {
type = "github";
owner = "christoph-heinrich";
repo = "mpv-touch-gestures";
flake = false;
};
eisa-scripts-src = {
type = "github";
owner = "Eisa01";
repo = "mpv-scripts";
flake = false;
};
##
## Theme sources
jellyfin-ultrachromic-src = {
type = "github";
owner = "CTalvio";
repo = "Ultrachromic";
flake = false;
};
bat-theme-src = {
type = "github";
flake = false;
owner = "matt1432";
repo = "bat";
flake = false;
};
firefox-gx-src = {
type = "github";
owner = "Godiesc";
repo = "firefox-gx";
ref = "v.9.1";
flake = false;
};
git-theme-src = {
bazarr-bulk = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "matt1432";
repo = "bazarr-bulk";
type = "github";
owner = "dracula";
repo = "git";
flake = false;
};
gtk-theme-src = {
caddy-plugins = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "matt1432";
repo = "nixos-caddy-cloudflare";
type = "github";
owner = "dracula";
repo = "gtk";
flake = false;
};
nvim-theme-src = {
type = "github";
owner = "Mofiqul";
repo = "dracula.nvim";
curseforge-server-downloader-src = {
flake = false;
};
plymouth-theme-src = {
owner = "Malpiszonekx4";
repo = "curseforge-server-downloader";
type = "github";
};
dracula-plymouth-src = {
flake = false;
owner = "matt1432";
repo = "dracula-plymouth";
flake = false;
};
xresources-theme-src = {
type = "github";
};
eisa-scripts-src = {
flake = false;
owner = "Eisa01";
repo = "mpv-scripts";
type = "github";
};
firefox-gx-src = {
flake = false;
owner = "Godiesc";
ref = "v.9.1";
repo = "firefox-gx";
type = "github";
};
flakegen.url = "github:jorsn/flakegen";
git-theme-src = {
flake = false;
owner = "dracula";
repo = "git";
type = "github";
};
gpu-screen-recorder-src = {
flake = false;
type = "git";
url = "https://repo.dec05eba.com/gpu-screen-recorder";
};
grim-hyprland = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "eriedaberrie";
repo = "grim-hyprland";
type = "github";
};
gtk-session-lock = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "Cu3PO42";
repo = "gtk-session-lock";
type = "github";
};
gtk-theme-src = {
flake = false;
owner = "dracula";
repo = "gtk";
type = "github";
};
headscale = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "juanfont";
repo = "headscale";
rev = "fef8261339899fe526777a7aa42df57ca02021c5";
type = "github";
};
home-manager = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "nix-community";
repo = "home-manager";
type = "github";
};
hypr-official-plugins = {
inputs.hyprland.follows = "hyprland";
owner = "hyprwm";
repo = "hyprland-plugins";
type = "github";
};
hypridle = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "hyprwm";
repo = "hypridle";
type = "github";
};
hyprland = {
inputs.nixpkgs.follows = "nixpkgs";
submodules = true;
type = "git";
url = "https://github.com/hyprwm/Hyprland";
};
jellyfin-flake = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "matt1432";
repo = "nixos-jellyfin";
type = "github";
};
jellyfin-ultrachromic-src = {
flake = false;
owner = "CTalvio";
repo = "Ultrachromic";
type = "github";
};
libratbag-src = {
flake = false;
owner = "libratbag";
repo = "libratbag";
type = "github";
};
modernx-src = {
flake = false;
owner = "cyl0";
repo = "ModernX";
type = "github";
};
mpv-persist-properties-src = {
flake = false;
owner = "d87";
repo = "mpv-persist-properties";
type = "github";
};
mpv-pointer-event-src = {
flake = false;
owner = "christoph-heinrich";
repo = "mpv-pointer-event";
type = "github";
};
mpv-touch-gestures-src = {
flake = false;
owner = "christoph-heinrich";
repo = "mpv-touch-gestures";
type = "github";
};
neovim-nightly = {
owner = "nix-community";
repo = "neovim-nightly-overlay";
type = "github";
};
nh = {
owner = "viperML";
repo = "nh";
type = "github";
};
nix-eval-jobs = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "nix-community";
ref = "release-2.21";
repo = "nix-eval-jobs";
type = "github";
};
nix-fast-build = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "Mic92";
repo = "nix-fast-build";
type = "github";
};
nix-gaming = {
owner = "fufexan";
repo = "nix-gaming";
type = "github";
};
nix-index-db = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "Mic92";
repo = "nix-index-database";
type = "github";
};
nix-melt = {
owner = "nix-community";
repo = "nix-melt";
type = "github";
};
nix-on-droid = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "nix-community";
repo = "nix-on-droid";
type = "github";
};
nixd = {
owner = "nix-community";
repo = "nixd";
type = "github";
};
nixpkgs = {
owner = "NixOS";
ref = "nixos-unstable";
repo = "nixpkgs";
type = "github";
};
nixpkgs-wayland = {
owner = "nix-community";
repo = "nixpkgs-wayland";
type = "github";
};
nms = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "matt1432";
repo = "nixos-minecraft-servers";
type = "github";
};
nur = {
owner = "nix-community";
repo = "NUR";
type = "github";
};
nurl = {
owner = "nix-community";
repo = "nurl";
type = "github";
};
nvim-theme-src = {
flake = false;
owner = "Mofiqul";
repo = "dracula.nvim";
type = "github";
};
pam-fprint-grosshack-src = {
flake = false;
owner = "mishakmak";
repo = "pam-fprint-grosshack";
type = "gitlab";
};
pcsd = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "matt1432";
repo = "nixos-pcsd";
type = "github";
};
piper-src = {
flake = false;
owner = "libratbag";
repo = "piper";
type = "github";
};
pokemon-colorscripts-src = {
flake = false;
owner = "phoneybadger";
repo = "pokemon-colorscripts";
type = "gitlab";
};
secrets = {
inputs.nixpkgs.follows = "nixpkgs";
type = "git";
url = "ssh://git@git.nelim.org/matt1432/nixos-secrets";
};
sops-nix = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "Mic92";
repo = "sops-nix";
type = "github";
};
stylelint-lsp = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "matt1432";
repo = "stylelint-lsp";
type = "github";
};
subsync = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "matt1432";
repo = "subsync";
rev = "ee9e1592ae4ec7c694d8857aa72be079d81ea209";
type = "github";
};
trash-d-src = {
flake = false;
owner = "rushsteve1";
repo = "trash-d";
type = "github";
};
vimplugin-easytables-src = {
flake = false;
owner = "Myzel394";
repo = "easytables.nvim";
type = "github";
};
vimplugin-ts-error-translator-src = {
flake = false;
owner = "dmmulroy";
repo = "ts-error-translator.nvim";
type = "github";
};
wpaperd = {
inputs.nixpkgs.follows = "nixpkgs";
owner = "danyspin97";
repo = "wpaperd";
type = "github";
};
xresources-src = {
flake = false;
owner = "dracula";
repo = "xresources";
flake = false;
type = "github";
};
##
#
};
}
outputs = inputs: inputs.flakegen ./flake.in.nix inputs;
}

View file

@ -1,11 +1,11 @@
{
persist-properties-src,
mpv-persist-properties-src,
buildLua,
...
}:
buildLua {
pname = "persist-properties";
version = persist-properties-src.shortRev;
version = mpv-persist-properties-src.shortRev;
src = persist-properties-src;
src = mpv-persist-properties-src;
}

View file

@ -1,11 +1,11 @@
{
pointer-event-src,
mpv-pointer-event-src,
buildLua,
...
}:
buildLua {
pname = "pointer-event";
version = pointer-event-src.shortRev;
version = mpv-pointer-event-src.shortRev;
src = pointer-event-src;
src = mpv-pointer-event-src;
}

View file

@ -1,11 +1,11 @@
{
touch-gestures-src,
mpv-touch-gestures-src,
buildLua,
...
}:
buildLua {
pname = "touch-gestures";
version = touch-gestures-src.shortRev;
version = mpv-touch-gestures-src.shortRev;
src = touch-gestures-src;
src = mpv-touch-gestures-src;
}

319
input.nix Normal file
View file

@ -0,0 +1,319 @@
let
inherit (builtins) listToAttrs map removeAttrs;
# Misc functions
mkInput = {type ? "github", ...} @ info: info // {inherit type;};
mkDep = info: (mkInput info) // {inputs.nixpkgs.follows = "nixpkgs";};
mkSrc = info: (mkInput info) // {flake = false;};
# Inputs
nixTools = {
nurl = mkInput {
owner = "nix-community";
repo = "nurl";
};
nix-index-db = mkDep {
owner = "Mic92";
repo = "nix-index-database";
};
nh = mkInput {
owner = "viperML";
repo = "nh";
};
nix-melt = mkInput {
owner = "nix-community";
repo = "nix-melt";
};
};
overlays = {
nixpkgs-wayland = mkInput {
owner = "nix-community";
repo = "nixpkgs-wayland";
};
nur = mkInput {
owner = "nix-community";
repo = "NUR";
};
nix-gaming = mkInput {
owner = "fufexan";
repo = "nix-gaming";
};
};
nvimInputs = {
neovim-nightly = mkInput {
owner = "nix-community";
repo = "neovim-nightly-overlay";
# FIXME: issue with grammars on latest unstable
# inputs.nixpkgs.follows = "nixpkgs";
};
stylelint-lsp = mkDep {
owner = "matt1432";
repo = "stylelint-lsp";
};
nixd = mkInput {
owner = "nix-community";
repo = "nixd";
};
# FIXME: get it from nixpkgs when it gets merged
basedpyright.url = "github:kiike/nixpkgs/pkgs/basedpyright";
};
clusterInputs = {
pcsd = mkDep {
owner = "matt1432";
repo = "nixos-pcsd";
};
headscale = mkDep {
owner = "juanfont";
repo = "headscale";
# FIXME: doesn't work on latest
rev = "fef8261339899fe526777a7aa42df57ca02021c5";
};
caddy-plugins = mkDep {
owner = "matt1432";
repo = "nixos-caddy-cloudflare";
};
};
serviviInputs = {
nms = mkDep {
owner = "matt1432";
repo = "nixos-minecraft-servers";
};
nix-eval-jobs = mkDep {
owner = "nix-community";
repo = "nix-eval-jobs";
ref = "release-2.21";
};
nix-fast-build = mkDep {
owner = "Mic92";
repo = "nix-fast-build";
};
};
nosInputs = {
arion = mkDep {
owner = "hercules-ci";
repo = "arion";
};
jellyfin-flake = mkDep {
owner = "matt1432";
repo = "nixos-jellyfin";
};
bazarr-bulk = mkDep {
owner = "matt1432";
repo = "bazarr-bulk";
};
subsync = mkDep {
owner = "matt1432";
repo = "subsync";
# Keep version that uses Sphinxbase
rev = "ee9e1592ae4ec7c694d8857aa72be079d81ea209";
};
};
desktopInputs = {
hyprlandInputs = {
hyprland = mkDep {
type = "git";
url = "https://github.com/hyprwm/Hyprland";
submodules = true;
};
hypr-official-plugins = mkInput {
owner = "hyprwm";
repo = "hyprland-plugins";
inputs.hyprland.follows = "hyprland";
};
Hyprspace = mkInput {
owner = "KZDKM";
repo = "Hyprspace";
inputs.hyprland.follows = "hyprland";
};
hypridle = mkDep {
owner = "hyprwm";
repo = "hypridle";
};
grim-hyprland = mkDep {
owner = "eriedaberrie";
repo = "grim-hyprland";
};
## Wayland
wpaperd = mkDep {
owner = "danyspin97";
repo = "wpaperd";
};
};
agsInputs = {
ags = mkDep {
owner = "Aylur";
repo = "ags";
};
astal = mkDep {
owner = "Aylur";
repo = "Astal";
};
gtk-session-lock = mkDep {
owner = "Cu3PO42";
repo = "gtk-session-lock";
};
};
};
srcs = [
# Nvim plugins
{
name = "vimplugin-easytables-src";
owner = "Myzel394";
repo = "easytables.nvim";
}
{
name = "vimplugin-ts-error-translator-src";
owner = "dmmulroy";
repo = "ts-error-translator.nvim";
}
# Overlays & packages
{
owner = "rushsteve1";
repo = "trash-d";
}
{
type = "gitlab";
owner = "mishakmak";
repo = "pam-fprint-grosshack";
}
{
type = "gitlab";
owner = "phoneybadger";
repo = "pokemon-colorscripts";
}
{
owner = "Malpiszonekx4";
repo = "curseforge-server-downloader";
}
{
name = "gpu-screen-recorder-src";
type = "git";
url = "https://repo.dec05eba.com/gpu-screen-recorder";
}
{
owner = "libratbag";
repo = "libratbag";
}
{
owner = "libratbag";
repo = "piper";
}
# MPV scripts
{
name = "modernx-src";
owner = "cyl0";
repo = "ModernX";
}
{
owner = "d87";
repo = "mpv-persist-properties";
}
{
owner = "christoph-heinrich";
repo = "mpv-pointer-event";
}
{
owner = "christoph-heinrich";
repo = "mpv-touch-gestures";
}
{
name = "eisa-scripts-src";
owner = "Eisa01";
repo = "mpv-scripts";
}
## Theme sources
{
name = "jellyfin-ultrachromic-src";
owner = "CTalvio";
repo = "Ultrachromic";
}
{
name = "bat-theme-src";
owner = "matt1432";
repo = "bat";
}
{
owner = "Godiesc";
repo = "firefox-gx";
ref = "v.9.1";
}
{
name = "git-theme-src";
owner = "dracula";
repo = "git";
}
{
name = "gtk-theme-src";
owner = "dracula";
repo = "gtk";
}
{
name = "nvim-theme-src";
owner = "Mofiqul";
repo = "dracula.nvim";
}
{
owner = "matt1432";
repo = "dracula-plymouth";
}
{
owner = "dracula";
repo = "xresources";
}
];
in {
inherit mkDep mkInput mkSrc;
otherInputs =
nixTools
// overlays
// nvimInputs
// clusterInputs
// serviviInputs
// nosInputs
// desktopInputs.hyprlandInputs
// desktopInputs.agsInputs
// (listToAttrs (map (x: {
name = x.name or "${x.repo}-src";
value = mkSrc (removeAttrs x ["name"]);
})
srcs));
}