Compare commits

..

24 commits

Author SHA1 Message Date
ea450ca4df
flake: move attic to flake=false
All checks were successful
/ check (push) Successful in 42s
2025-05-01 22:17:20 +02:00
daae64b03e
modules/system/flake-qol: double copying nixpkgs is no more 2025-05-01 22:17:20 +02:00
32681a413a
pkgs: build attic without relying on flakes 2025-05-01 22:17:20 +02:00
e0675973ed
nilla: add inputs argument 2025-05-01 22:17:20 +02:00
603bd044d8
pkgs/conduit: remove dependency on fenix and crane 2025-05-01 22:17:20 +02:00
c43055ebe8
nilla: add ci.check 2025-05-01 22:17:20 +02:00
327b919d7d
modules/nilla: configurations -> systems 2025-05-01 22:17:20 +02:00
ea37772c34
modules/nilla: flake compatibility module 2025-05-01 22:17:20 +02:00
a33554036b
hosts: simplify builders 2025-05-01 22:17:20 +02:00
b704b5434f
inputs: lazy-trees at home 2025-05-01 22:17:20 +02:00
cde0bc94e8
flake.lock: update 2025-05-01 22:17:20 +02:00
0476c020ea
flake: remove flake-parts 2025-05-01 22:17:20 +02:00
b00404565c
modules: migrate to nilla 2025-05-01 22:17:20 +02:00
4530b5e6a6
hosts: migrate to nilla 2025-05-01 22:17:20 +02:00
ecaad3220c
services: migrate to nilla 2025-05-01 22:17:20 +02:00
cfdabda225
services: prepare for migration 2025-05-01 22:17:20 +02:00
6526f3b4e5
flake: simplify transpose logic 2025-05-01 22:17:20 +02:00
9345ef7c12
treefmt: migrate to nilla 2025-05-01 22:17:20 +02:00
5c892cd2e5
wrappers: migrate to nilla 2025-05-01 22:17:20 +02:00
79a4ee511e
pkgs: migrate to nilla 2025-05-01 22:17:20 +02:00
e8744a168b
flake: start moving away from flake-parts 2025-05-01 22:17:20 +02:00
b1659b13fe
nilla: modularize 2025-05-01 22:17:20 +02:00
c87a851207
nilla: migrate devshells 2025-05-01 22:17:20 +02:00
5efb7d00a8
nilla: init 2025-05-01 22:17:20 +02:00
11 changed files with 109 additions and 202 deletions

162
flake.lock generated
View file

@ -44,24 +44,7 @@
} }
}, },
"attic": { "attic": {
"inputs": { "flake": false,
"crane": [
"crane"
],
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"lix": [
"lix"
],
"lix-module": [
"lix-module"
],
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": { "locked": {
"lastModified": 1742679462, "lastModified": 1742679462,
"narHash": "sha256-L9q9KDqiJEREM/GRnSo4vB9VCvclmdRT9vXuFwBmb9Y=", "narHash": "sha256-L9q9KDqiJEREM/GRnSo4vB9VCvclmdRT9vXuFwBmb9Y=",
@ -110,12 +93,28 @@
} }
}, },
"crane": { "crane": {
"flake": false,
"locked": { "locked": {
"lastModified": 1742394900, "lastModified": 1745454774,
"narHash": "sha256-vVOAp9ahvnU+fQoKd4SEXB2JG2wbENkpqcwlkIXgUC0=", "narHash": "sha256-oLvmxOnsEKGtwczxp/CwhrfmQUG2ym24OMWowcoRhH8=",
"owner": "ipetkov", "owner": "ipetkov",
"repo": "crane", "repo": "crane",
"rev": "70947c1908108c0c551ddfd73d4f750ff2ea67cd", "rev": "efd36682371678e2b6da3f108fdb5c613b3ec598",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"crane_2": {
"locked": {
"lastModified": 1745454774,
"narHash": "sha256-oLvmxOnsEKGtwczxp/CwhrfmQUG2ym24OMWowcoRhH8=",
"owner": "ipetkov",
"repo": "crane",
"rev": "efd36682371678e2b6da3f108fdb5c613b3ec598",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -165,27 +164,6 @@
"type": "github" "type": "github"
} }
}, },
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1742452566,
"narHash": "sha256-sVuLDQ2UIWfXUBbctzrZrXM2X05YjX08K7XHMztt36E=",
"owner": "nix-community",
"repo": "fenix",
"rev": "7d9ba794daf5e8cc7ee728859bc688d8e26d5f06",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"firefox-darwin": { "firefox-darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -207,22 +185,6 @@
} }
}, },
"flake-compat": { "flake-compat": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1696426674,
@ -239,27 +201,6 @@
} }
}, },
"flake-parts": { "flake-parts": {
"inputs": {
"nixpkgs-lib": [
"attic",
"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_2": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
@ -432,7 +373,7 @@
"mailserver": { "mailserver": {
"inputs": { "inputs": {
"blobs": "blobs", "blobs": "blobs",
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
@ -454,7 +395,7 @@
}, },
"niko-nur": { "niko-nur": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
@ -487,27 +428,6 @@
"type": "github" "type": "github"
} }
}, },
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"attic",
"nixpkgs"
]
},
"locked": {
"lastModified": 1737420293,
"narHash": "sha256-F1G5ifvqTpJq7fdkT34e/Jy9VCyzd5XfJ9TO8fHhJWE=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "f4158fa080ef4503c8f4c820967d946c2af31ec9",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1723603349, "lastModified": 1723603349,
@ -551,22 +471,6 @@
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
} }
}, },
"nixpkgs-stable": {
"locked": {
"lastModified": 1735563628,
"narHash": "sha256-OnSAY7XDSx7CtDoqNh8jwVwh4xNL/2HaJxGjryLWzX8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b134951a4c9f3c995fd7be05f3243f8ecd65d798",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1743259260, "lastModified": 1743259260,
@ -612,7 +516,6 @@
"crane": "crane", "crane": "crane",
"darwin": "darwin", "darwin": "darwin",
"disko": "disko", "disko": "disko",
"fenix": "fenix",
"firefox-darwin": "firefox-darwin", "firefox-darwin": "firefox-darwin",
"helix": "helix", "helix": "helix",
"home-manager": "home-manager", "home-manager": "home-manager",
@ -629,23 +532,6 @@
"zjstatus": "zjstatus" "zjstatus": "zjstatus"
} }
}, },
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1742296961,
"narHash": "sha256-gCpvEQOrugHWLimD1wTFOJHagnSEP6VYBDspq96Idu0=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "15d87419f1a123d8f888d608129c3ce3ff8f13d4",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"rust-overlay": { "rust-overlay": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -817,9 +703,7 @@
}, },
"zjstatus": { "zjstatus": {
"inputs": { "inputs": {
"crane": [ "crane": "crane_2",
"crane"
],
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_3",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"

View file

@ -47,13 +47,6 @@
url = "gitlab:famedly/conduit?ref=next"; url = "gitlab:famedly/conduit?ref=next";
flake = false; flake = false;
}; };
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
crane = {
url = "github:ipetkov/crane";
};
firefox-darwin = { firefox-darwin = {
url = "github:bandithedoge/nixpkgs-firefox-darwin"; url = "github:bandithedoge/nixpkgs-firefox-darwin";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -63,10 +56,11 @@
}; };
attic = { attic = {
url = "git+https://git.lix.systems/nrabulinski/attic.git"; url = "git+https://git.lix.systems/nrabulinski/attic.git";
inputs.nixpkgs.follows = "nixpkgs"; flake = false;
inputs.crane.follows = "crane"; };
inputs.lix.follows = "lix"; crane = {
inputs.lix-module.follows = "lix-module"; url = "github:ipetkov/crane";
flake = false;
}; };
helix = { helix = {
url = "github:helix-editor/helix"; url = "github:helix-editor/helix";
@ -75,7 +69,6 @@
zjstatus = { zjstatus = {
url = "github:dj95/zjstatus"; url = "github:dj95/zjstatus";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.crane.follows = "crane";
}; };
lix = { lix = {
url = "git+https://git.lix.systems/lix-project/lix.git"; url = "git+https://git.lix.systems/lix-project/lix.git";

View file

@ -1,9 +1,7 @@
{ {
config, config,
inputs,
}: }:
let
inputs = builtins.mapAttrs (_: input: input.result) config.inputs;
in
{ {
includes = [ includes = [
./kazuki ./kazuki

View file

@ -1,6 +1,7 @@
let let
lock = builtins.fromJSON (builtins.readFile ./flake.lock); lock = builtins.fromJSON (builtins.readFile ./flake.lock);
inherit (lock.nodes.__flake-compat.locked) narHash rev url; nodeName = lock.nodes.root.inputs.__flake-compat;
inherit (lock.nodes.${nodeName}.locked) narHash rev url;
flake-compat = builtins.fetchTarball { flake-compat = builtins.fetchTarball {
url = "${url}/archive/${rev}.tar.gz"; url = "${url}/archive/${rev}.tar.gz";
sha256 = narHash; sha256 = narHash;

View file

@ -1,8 +1,8 @@
{ {
config, config,
inputs,
}: }:
let let
inputs = builtins.mapAttrs (_: input: input.result) config.inputs;
perInput = system: flake: { perInput = system: flake: {
packages = flake.packages.${system}; packages = flake.packages.${system};
}; };
@ -25,12 +25,19 @@ in
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
inputs.mailserver.nixosModules.default inputs.mailserver.nixosModules.default
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
inputs.attic.nixosModules.atticd "${inputs.attic}/nixos/atticd.nix"
inputs.lix-module.nixosModules.default inputs.lix-module.nixosModules.default
{ {
disabledModules = [ disabledModules = [
"services/networking/atticd.nix" "services/networking/atticd.nix"
]; ];
services.atticd.useFlakeCompatOverlay = false;
nixpkgs.overlays = [
(final: _: {
attic-client = config.packages.attic-client.result.${final.system};
attic-server = config.packages.attic-server.result.${final.system};
})
];
} }
]; ];
}; };

View file

@ -1,6 +1,7 @@
{ {
config, config,
lib, lib,
inputs,
}: }:
{ {
config.builders.nixpkgs-flake = { config.builders.nixpkgs-flake = {
@ -14,8 +15,7 @@
build = build =
pkg: pkg:
lib.attrs.generate pkg.systems ( lib.attrs.generate pkg.systems (
system: system: inputs.nixpkgs.legacyPackages.${system}.callPackage pkg.package pkg.settings.args
config.inputs.nixpkgs.result.legacyPackages.${system}.callPackage pkg.package pkg.settings.args
); );
}; };
} }

View file

@ -7,6 +7,18 @@
}: }:
let let
cfg = config.settei.flake-qol; cfg = config.settei.flake-qol;
nixpkgsInputToFlakeRef =
input:
if input._type or "" == "flake" then
{
type = "github";
owner = "NixOS";
repo = "nixpkgs";
inherit (input) lastModified narHash rev;
}
else
input;
in in
{ {
_file = ./flake-qol.nix; _file = ./flake-qol.nix;
@ -20,6 +32,12 @@ in
default = true; default = true;
}; };
inputs = mkOption { type = types.unspecified; }; inputs = mkOption { type = types.unspecified; };
nixpkgsRef = mkOption {
type = types.unspecified;
default = cfg.inputs.nixpkgs;
apply =
ref: if builtins.isString ref then builtins.parseFlakeRef ref else nixpkgsInputToFlakeRef ref;
};
inputs-flakes = mkOption { inputs-flakes = mkOption {
type = types.attrs; type = types.attrs;
readOnly = true; readOnly = true;
@ -44,8 +62,8 @@ in
settei.user.extraArgs = reexportedArgs; settei.user.extraArgs = reexportedArgs;
nix = { nix = {
registry = lib.mapAttrs (_: flake: { inherit flake; }) cfg.inputs-flakes; registry.nixpkgs.to = cfg.nixpkgsRef;
nixPath = lib.mapAttrsToList (name: _: "${name}=flake:${name}") cfg.inputs-flakes; nixPath = [ "nixpkgs=flake:nixpkgs" ];
}; };
}; };
} }

View file

@ -18,6 +18,10 @@
inherit src; inherit src;
loader = "raw"; loader = "raw";
}) inputs; }) inputs;
# Add inputs argument so modules can conveniently use it
config.__module__.args.dynamic.inputs = builtins.mapAttrs (
_name: input: input.result
) config.inputs;
config.packages = config.packages =
let let
@ -43,15 +47,6 @@
getPkgs = system: builtins.mapAttrs (_: pkg: pkg.result.${system}) config.packages; getPkgs = system: builtins.mapAttrs (_: pkg: pkg.result.${system}) config.packages;
in in
{ {
# Re-export for convenience and for caching
attic-client = mkPackageFlakeOutput {
input = "attic";
output = "attic-client";
};
attic-server = mkPackageFlakeOutput {
input = "attic";
output = "attic-server";
};
agenix = mkPackageFlakeOutput { input = "agenix"; }; agenix = mkPackageFlakeOutput { input = "agenix"; };
base-packages = mkPackage ( base-packages = mkPackage (
{ symlinkJoin, system }: { symlinkJoin, system }:

View file

@ -1,10 +1,6 @@
{ {
lib, lib,
stdenv, stdenv,
pkgs,
system,
fenix,
crane,
src, src,
libiconv, libiconv,
rocksdb, rocksdb,
@ -12,27 +8,18 @@
rustPlatform, rustPlatform,
}: }:
let let
rust = manifest = (builtins.fromTOML (builtins.readFile "${src}/Cargo.toml")).package;
with fenix.${system};
combine [
stable.cargo
stable.rustc
];
crane' = (crane pkgs).overrideToolchain rust;
rocksdb' = rocksdb.overrideAttrs (
final: prev: {
version = "9.1.1";
src = prev.src.override {
rev = "v${final.version}";
hash = "sha256-/Xf0bzNJPclH9IP80QNaABfhj4IAR5LycYET18VFCXc=";
};
}
);
in in
crane'.buildPackage { rustPlatform.buildRustPackage {
pname = manifest.name;
inherit (manifest) version;
inherit src; inherit src;
strictDeps = true; strictDeps = true;
useFetchCargoVendor = true;
cargoHash = "sha256-wESDxtKRMm/jyCr4kc20UuHGcE2s+OCMjfL+l1XihnA=";
nativeBuildInputs = [ rustPlatform.bindgenHook ]; nativeBuildInputs = [ rustPlatform.bindgenHook ];
buildInputs = lib.optionals stdenv.isDarwin [ buildInputs = lib.optionals stdenv.isDarwin [
@ -42,8 +29,8 @@ crane'.buildPackage {
]; ];
# Use system RocksDB # Use system RocksDB
ROCKSDB_INCLUDE_DIR = "${rocksdb'}/include"; ROCKSDB_INCLUDE_DIR = "${rocksdb}/include";
ROCKSDB_LIB_DIR = "${rocksdb'}/lib"; ROCKSDB_LIB_DIR = "${rocksdb}/lib";
NIX_OUTPATH_USED_AS_RANDOM_SEED = "randomseed"; NIX_OUTPATH_USED_AS_RANDOM_SEED = "randomseed";
CONDUIT_VERSION_EXTRA = src.shortRev; CONDUIT_VERSION_EXTRA = src.shortRev;
} }

View file

@ -1,4 +1,8 @@
{ config }: {
config,
lib,
inputs,
}:
let let
systems = [ systems = [
"x86_64-linux" "x86_64-linux"
@ -9,16 +13,21 @@ let
mkPackage = package: { mkPackage = package: {
inherit systems package builder; inherit systems package builder;
}; };
atticPkgs = lib.attrs.generate systems (
system:
let
pkgs = inputs.nixpkgs.legacyPackages.${system}.extend inputs.lix-module.overlays.default;
craneLib = import inputs.crane { inherit pkgs; };
in
pkgs.callPackage "${inputs.attic}/crane.nix" { inherit craneLib; }
);
in in
{ {
config.packages.conduit-next = { config.packages.conduit-next = {
inherit systems builder; inherit systems builder;
package = import ./conduit; package = import ./conduit;
settings.args = { settings.args = {
src = config.inputs.conduit-src.result; src = inputs.conduit-src;
crane = config.inputs.crane.result.mkLib;
fenix = config.inputs.fenix.result.packages;
}; };
}; };
@ -49,4 +58,15 @@ in
''; '';
} }
); );
config.packages.attic-client = {
inherit systems;
builder = "custom-load";
package = { system }: atticPkgs.${system}.attic-client;
};
config.packages.attic-server = {
inherit systems;
builder = "custom-load";
package = { system }: atticPkgs.${system}.attic-server;
};
} }

View file

@ -1,4 +1,8 @@
{ lib, config }: {
lib,
config,
inputs,
}:
let let
systems = [ systems = [
"x86_64-linux" "x86_64-linux"
@ -7,8 +11,8 @@ let
]; ];
wrappedPerSystem = lib.attrs.generate systems ( wrappedPerSystem = lib.attrs.generate systems (
system: system:
config.inputs.wrapper-manager-hm-compat.result.lib { inputs.wrapper-manager-hm-compat.lib {
pkgs = config.inputs.nixpkgs.result.legacyPackages.${system}; pkgs = inputs.nixpkgs.legacyPackages.${system};
modules = [ modules = [
./starship ./starship
./helix ./helix
@ -17,7 +21,7 @@ let
./fish ./fish
./wezterm ./wezterm
]; ];
specialArgs.inputs = builtins.mapAttrs (_: input: input.result) config.inputs; specialArgs = { inherit inputs; };
} }
); );
wrappedPerSystem' = builtins.mapAttrs (_: wrapped: wrapped.config.build.packages) wrappedPerSystem; wrappedPerSystem' = builtins.mapAttrs (_: wrapped: wrapped.config.build.packages) wrappedPerSystem;