make things work with flake-parts
also don't use my fork for btrbk anymore
This commit is contained in:
parent
ff3df36198
commit
193fc258b9
4 changed files with 223 additions and 151 deletions
126
flake.lock
generated
126
flake.lock
generated
|
@ -80,6 +80,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat_2": {
|
"flake-compat_2": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1696426674,
|
||||||
|
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1696426674,
|
"lastModified": 1696426674,
|
||||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||||
|
@ -94,6 +110,24 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1736143030,
|
||||||
|
"narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-parts_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
"lanzaboote",
|
"lanzaboote",
|
||||||
|
@ -114,7 +148,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-parts_2": {
|
"flake-parts_3": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
"nixvim",
|
"nixvim",
|
||||||
|
@ -172,12 +206,34 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"git-hooks": {
|
"git-hooks": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"gitignore": "gitignore",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1737043064,
|
||||||
|
"narHash": "sha256-I/OuxGwXwRi5gnFPsyCvVR+IfFstA+QXEpHu1hvsgD8=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"rev": "94ee657f6032d913fe0ef49adaa743804635b0bb",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"git-hooks_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": [
|
"flake-compat": [
|
||||||
"nixvim",
|
"nixvim",
|
||||||
"flake-compat"
|
"flake-compat"
|
||||||
],
|
],
|
||||||
"gitignore": "gitignore_2",
|
"gitignore": "gitignore_3",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixvim",
|
"nixvim",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
|
@ -198,6 +254,27 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitignore": {
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"git-hooks",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709087332,
|
||||||
|
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gitignore_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"lanzaboote",
|
"lanzaboote",
|
||||||
|
@ -219,7 +296,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitignore_2": {
|
"gitignore_3": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixvim",
|
"nixvim",
|
||||||
|
@ -313,8 +390,8 @@
|
||||||
"lanzaboote": {
|
"lanzaboote": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"crane": "crane",
|
"crane": "crane",
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat_2",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts_2",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
|
@ -374,22 +451,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-btrbk": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1735945390,
|
|
||||||
"narHash": "sha256-isFSp8EsqnFJE7o07XdT/eia0Rtzvz6NqLt4tCdFido=",
|
|
||||||
"owner": "cything",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "acf701b49a7687e23b4b18701d4ab62285dec029",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "cything",
|
|
||||||
"ref": "btrbk",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs-garage": {
|
"nixpkgs-garage": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1736921030,
|
"lastModified": 1736921030,
|
||||||
|
@ -406,6 +467,18 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-lib": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1735774519,
|
||||||
|
"narHash": "sha256-CewEm1o2eVAnoqb6Ml+Qi9Gg/EfNAxbRx1lANGVyoLI=",
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710695816,
|
"lastModified": 1710695816,
|
||||||
|
@ -425,9 +498,9 @@
|
||||||
"nixvim": {
|
"nixvim": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"devshell": "devshell",
|
"devshell": "devshell",
|
||||||
"flake-compat": "flake-compat_2",
|
"flake-compat": "flake-compat_3",
|
||||||
"flake-parts": "flake-parts_2",
|
"flake-parts": "flake-parts_3",
|
||||||
"git-hooks": "git-hooks",
|
"git-hooks": "git-hooks_2",
|
||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
"nix-darwin": "nix-darwin",
|
"nix-darwin": "nix-darwin",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -479,7 +552,7 @@
|
||||||
"lanzaboote",
|
"lanzaboote",
|
||||||
"flake-compat"
|
"flake-compat"
|
||||||
],
|
],
|
||||||
"gitignore": "gitignore",
|
"gitignore": "gitignore_2",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"lanzaboote",
|
"lanzaboote",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
|
@ -503,10 +576,11 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"disko": "disko",
|
"disko": "disko",
|
||||||
|
"flake-parts": "flake-parts",
|
||||||
|
"git-hooks": "git-hooks",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"lanzaboote": "lanzaboote",
|
"lanzaboote": "lanzaboote",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-btrbk": "nixpkgs-btrbk",
|
|
||||||
"nixpkgs-garage": "nixpkgs-garage",
|
"nixpkgs-garage": "nixpkgs-garage",
|
||||||
"nixvim": "nixvim",
|
"nixvim": "nixvim",
|
||||||
"sops-nix": "sops-nix",
|
"sops-nix": "sops-nix",
|
||||||
|
|
122
flake.nix
122
flake.nix
|
@ -27,21 +27,21 @@
|
||||||
url = "github:nix-community/nixvim";
|
url = "github:nix-community/nixvim";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
|
git-hooks = {
|
||||||
|
url = "github:cachix/git-hooks.nix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
nixpkgs-btrbk.url = "github:cything/nixpkgs/btrbk"; # unmerged PR
|
|
||||||
nixpkgs-garage.url = "github:cything/nixpkgs/garage-module"; # unmerged PR
|
nixpkgs-garage.url = "github:cything/nixpkgs/garage-module"; # unmerged PR
|
||||||
};
|
};
|
||||||
|
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
extra-substituters = [
|
extra-substituters = [
|
||||||
"https://cache.cything.io/central"
|
"https://cache.cything.io/central"
|
||||||
"https://cache.cything.io/infra-ci"
|
|
||||||
"https://cache.cything.io/attic"
|
|
||||||
];
|
];
|
||||||
extra-trusted-public-keys = [
|
extra-trusted-public-keys = [
|
||||||
"central:uWhjva6m6dhC2hqNisjn2hXGvdGBs19vPkA1dPEuwFg="
|
"central:uWhjva6m6dhC2hqNisjn2hXGvdGBs19vPkA1dPEuwFg="
|
||||||
"infra-ci:xG5f5tddUBcvToYjlpHD5OY/puYQkKmgKeIQCshNs38="
|
|
||||||
"attic:HL3hVpqXxwcF7Q1R+IvU2i0+YxIjQA2xxKM5EJMXLLs="
|
|
||||||
];
|
];
|
||||||
builders-use-substitutes = true;
|
builders-use-substitutes = true;
|
||||||
};
|
};
|
||||||
|
@ -53,59 +53,55 @@
|
||||||
home-manager,
|
home-manager,
|
||||||
treefmt,
|
treefmt,
|
||||||
disko,
|
disko,
|
||||||
|
flake-parts,
|
||||||
...
|
...
|
||||||
}@inputs:
|
}@inputs:
|
||||||
let
|
flake-parts.lib.mkFlake { inherit inputs; } (
|
||||||
lib = nixpkgs.lib;
|
{ ... }:
|
||||||
inherit (self) outputs;
|
{
|
||||||
|
imports = [
|
||||||
systems = [ "x86_64-linux" ];
|
inputs.git-hooks.flakeModule
|
||||||
forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system});
|
];
|
||||||
overlays = [
|
debug = true;
|
||||||
# (overlayPkgsFromFlake inputs.eza [
|
systems = [
|
||||||
# ])
|
"x86_64-linux"
|
||||||
] ++ import ./overlay;
|
];
|
||||||
|
perSystem =
|
||||||
pkgsFor = lib.genAttrs systems (
|
{
|
||||||
system:
|
pkgs,
|
||||||
import nixpkgs {
|
system,
|
||||||
inherit system overlays;
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
# make pkgs available to `perSystem`
|
||||||
|
_module.args.pkgs = import inputs.nixpkgs {
|
||||||
|
inherit system;
|
||||||
config = {
|
config = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
);
|
|
||||||
|
|
||||||
treefmtEval = forEachSystem (
|
pre-commit = {
|
||||||
pkgs:
|
check.enable = true;
|
||||||
treefmt.lib.evalModule pkgs {
|
settings.hooks = {
|
||||||
projectRootFile = "flake.nix";
|
nixfmt-rfc-style.enable = true;
|
||||||
programs.nixfmt.enable = true;
|
};
|
||||||
programs.stylua.enable = true;
|
};
|
||||||
programs.yamlfmt.enable = true;
|
|
||||||
programs.typos.enable = true;
|
|
||||||
programs.shellcheck.enable = true;
|
|
||||||
programs.deadnix.enable = true;
|
|
||||||
|
|
||||||
settings.global.excludes = [ "secrets/*" ];
|
formatter = pkgs.nixfmt-rfc-style;
|
||||||
}
|
};
|
||||||
);
|
|
||||||
in
|
|
||||||
{
|
|
||||||
formatter = forEachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
|
|
||||||
checks = forEachSystem (pkgs: {
|
|
||||||
formatting = treefmtEval.${pkgs.system}.config.build.check self;
|
|
||||||
});
|
|
||||||
# lets us build overlaid packages with `nix build .#<package>`
|
|
||||||
packages = pkgsFor;
|
|
||||||
|
|
||||||
|
flake = {
|
||||||
nixosConfigurations =
|
nixosConfigurations =
|
||||||
let
|
let
|
||||||
pkgs = pkgsFor.x86_64-linux;
|
pkgs = import nixpkgs {
|
||||||
|
config.allowUnfree = true;
|
||||||
|
system = "x86_64-linux";
|
||||||
|
};
|
||||||
|
lib = nixpkgs.lib;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
ytnix = lib.nixosSystem {
|
ytnix = lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs outputs; };
|
|
||||||
modules = [
|
modules = [
|
||||||
{
|
{
|
||||||
nixpkgs = { inherit pkgs; };
|
nixpkgs = { inherit pkgs; };
|
||||||
|
@ -116,9 +112,8 @@
|
||||||
inputs.lanzaboote.nixosModules.lanzaboote
|
inputs.lanzaboote.nixosModules.lanzaboote
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
chunk = lib.nixosSystem {
|
chunk = lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs outputs; };
|
specialArgs = { inherit inputs; };
|
||||||
modules = [
|
modules = [
|
||||||
{
|
{
|
||||||
nixpkgs = { inherit pkgs; };
|
nixpkgs = { inherit pkgs; };
|
||||||
|
@ -134,7 +129,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
titan = lib.nixosSystem {
|
titan = lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs outputs; };
|
specialArgs = { inherit inputs; };
|
||||||
modules = [
|
modules = [
|
||||||
{
|
{
|
||||||
nixpkgs = { inherit pkgs; };
|
nixpkgs = { inherit pkgs; };
|
||||||
|
@ -146,29 +141,36 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
homeConfigurations =
|
||||||
homeConfigurations = {
|
let
|
||||||
"yt@ytnix" = home-manager.lib.homeManagerConfiguration {
|
pkgs = import nixpkgs {
|
||||||
pkgs = pkgsFor.x86_64-linux;
|
config.allowUnfree = true;
|
||||||
extraSpecialArgs = { inherit inputs outputs; };
|
system = "x86_64-linux";
|
||||||
|
};
|
||||||
|
lib = home-manager.lib;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
"yt@ytnix" = lib.homeManagerConfiguration {
|
||||||
|
inherit pkgs;
|
||||||
|
extraSpecialArgs = { inherit inputs; };
|
||||||
modules = [
|
modules = [
|
||||||
./home/yt/ytnix.nix
|
./home/yt/ytnix.nix
|
||||||
inputs.nixvim.homeManagerModules.nixvim
|
inputs.nixvim.homeManagerModules.nixvim
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
"yt@chunk" = home-manager.lib.homeManagerConfiguration {
|
"yt@chunk" = lib.homeManagerConfiguration {
|
||||||
pkgs = pkgsFor.x86_64-linux;
|
inherit pkgs;
|
||||||
extraSpecialArgs = { inherit inputs outputs; };
|
extraSpecialArgs = { inherit inputs; };
|
||||||
modules = [
|
modules = [
|
||||||
./home/yt/chunk.nix
|
./home/yt/chunk.nix
|
||||||
inputs.nixvim.homeManagerModules.nixvim
|
inputs.nixvim.homeManagerModules.nixvim
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
"codespace@codespace" = home-manager.lib.homeManagerConfiguration {
|
"codespace@codespace" = lib.homeManagerConfiguration {
|
||||||
pkgs = pkgsFor.x86_64-linux;
|
inherit pkgs;
|
||||||
extraSpecialArgs = { inherit inputs outputs; };
|
extraSpecialArgs = { inherit inputs; };
|
||||||
modules = [
|
modules = [
|
||||||
./home/yt/codespace.nix
|
./home/yt/codespace.nix
|
||||||
inputs.nixvim.homeManagerModules.nixvim
|
inputs.nixvim.homeManagerModules.nixvim
|
||||||
|
@ -177,3 +179,5 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
programs.vscode = {
|
programs.vscode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.vscodium;
|
package = pkgs.vscodium;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
inputs,
|
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
@ -10,12 +9,6 @@
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../common.nix
|
../common.nix
|
||||||
../zsh.nix
|
../zsh.nix
|
||||||
{
|
|
||||||
disabledModules = [
|
|
||||||
"services/backup/btrbk.nix"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
(inputs.nixpkgs-btrbk + "/nixos/modules/services/backup/btrbk.nix")
|
|
||||||
];
|
];
|
||||||
|
|
||||||
sops.age.keyFile = "/root/.config/sops/age/keys.txt";
|
sops.age.keyFile = "/root/.config/sops/age/keys.txt";
|
||||||
|
|
Loading…
Add table
Reference in a new issue