Compare commits

..

19 commits

Author SHA1 Message Date
30f038df60
nilla: add ci.check
All checks were successful
/ check (push) Successful in 1m25s
2025-04-23 16:33:46 +02:00
48fe28205f
modules/nilla: configurations -> systems 2025-04-23 10:30:57 +02:00
3d6df3535d
modules/nilla: flake compatibility module 2025-04-23 10:30:57 +02:00
8c0ae05bd6
hosts: simplify builders 2025-04-23 10:30:57 +02:00
ebfec0baca
inputs: lazy-trees at home 2025-04-23 10:30:57 +02:00
7a565b01f4
flake.lock: update 2025-04-23 10:30:57 +02:00
17eac4a814
flake: remove flake-parts 2025-04-23 10:30:57 +02:00
63d9f0c078
modules: migrate to nilla 2025-04-23 10:30:57 +02:00
463bd5f849
hosts: migrate to nilla 2025-04-23 10:30:56 +02:00
7fcb5dfca5
services: migrate to nilla 2025-04-23 10:30:27 +02:00
430c02f60c
services: prepare for migration 2025-04-23 10:29:52 +02:00
22313087ff
flake: simplify transpose logic 2025-04-23 10:28:20 +02:00
8526bb5ab5
treefmt: migrate to nilla 2025-04-23 10:28:19 +02:00
e3dcc2b5e5
wrappers: migrate to nilla 2025-04-23 10:26:47 +02:00
2542e4551a
pkgs: migrate to nilla 2025-04-23 10:26:46 +02:00
173bb89f3a
flake: start moving away from flake-parts 2025-04-23 10:24:43 +02:00
ca5e902727
nilla: modularize 2025-04-23 10:24:43 +02:00
b3e334def9
nilla: migrate devshells 2025-04-23 10:24:43 +02:00
1bc3d4739c
nilla: init 2025-04-23 10:24:43 +02:00
11 changed files with 202 additions and 109 deletions

162
flake.lock generated
View file

@ -44,7 +44,24 @@
}
},
"attic": {
"flake": false,
"inputs": {
"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": {
"lastModified": 1742679462,
"narHash": "sha256-L9q9KDqiJEREM/GRnSo4vB9VCvclmdRT9vXuFwBmb9Y=",
@ -93,28 +110,12 @@
}
},
"crane": {
"flake": false,
"locked": {
"lastModified": 1745454774,
"narHash": "sha256-oLvmxOnsEKGtwczxp/CwhrfmQUG2ym24OMWowcoRhH8=",
"lastModified": 1742394900,
"narHash": "sha256-vVOAp9ahvnU+fQoKd4SEXB2JG2wbENkpqcwlkIXgUC0=",
"owner": "ipetkov",
"repo": "crane",
"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",
"rev": "70947c1908108c0c551ddfd73d4f750ff2ea67cd",
"type": "github"
},
"original": {
@ -164,6 +165,27 @@
"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": {
"inputs": {
"nixpkgs": [
@ -185,6 +207,22 @@
}
},
"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,
"locked": {
"lastModified": 1696426674,
@ -201,6 +239,27 @@
}
},
"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": {
"nixpkgs-lib": "nixpkgs-lib"
},
@ -373,7 +432,7 @@
"mailserver": {
"inputs": {
"blobs": "blobs",
"flake-compat": "flake-compat",
"flake-compat": "flake-compat_2",
"nixpkgs": [
"nixpkgs"
],
@ -395,7 +454,7 @@
},
"niko-nur": {
"inputs": {
"flake-parts": "flake-parts",
"flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs"
},
"locked": {
@ -428,6 +487,27 @@
"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": {
"locked": {
"lastModified": 1723603349,
@ -471,6 +551,22 @@
"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": {
"locked": {
"lastModified": 1743259260,
@ -516,6 +612,7 @@
"crane": "crane",
"darwin": "darwin",
"disko": "disko",
"fenix": "fenix",
"firefox-darwin": "firefox-darwin",
"helix": "helix",
"home-manager": "home-manager",
@ -532,6 +629,23 @@
"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": {
"inputs": {
"nixpkgs": [
@ -703,7 +817,9 @@
},
"zjstatus": {
"inputs": {
"crane": "crane_2",
"crane": [
"crane"
],
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixpkgs"

View file

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

View file

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

View file

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

View file

@ -1,8 +1,8 @@
{
config,
inputs,
}:
let
inputs = builtins.mapAttrs (_: input: input.result) config.inputs;
perInput = system: flake: {
packages = flake.packages.${system};
};
@ -25,19 +25,12 @@ in
inputs.disko.nixosModules.disko
inputs.mailserver.nixosModules.default
inputs.home-manager.nixosModules.home-manager
"${inputs.attic}/nixos/atticd.nix"
inputs.attic.nixosModules.atticd
inputs.lix-module.nixosModules.default
{
disabledModules = [
"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,7 +1,6 @@
{
config,
lib,
inputs,
}:
{
config.builders.nixpkgs-flake = {
@ -15,7 +14,8 @@
build =
pkg:
lib.attrs.generate pkg.systems (
system: inputs.nixpkgs.legacyPackages.${system}.callPackage pkg.package pkg.settings.args
system:
config.inputs.nixpkgs.result.legacyPackages.${system}.callPackage pkg.package pkg.settings.args
);
};
}

View file

@ -7,18 +7,6 @@
}:
let
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
{
_file = ./flake-qol.nix;
@ -32,12 +20,6 @@ in
default = true;
};
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 {
type = types.attrs;
readOnly = true;
@ -62,8 +44,8 @@ in
settei.user.extraArgs = reexportedArgs;
nix = {
registry.nixpkgs.to = cfg.nixpkgsRef;
nixPath = [ "nixpkgs=flake:nixpkgs" ];
registry = lib.mapAttrs (_: flake: { inherit flake; }) cfg.inputs-flakes;
nixPath = lib.mapAttrsToList (name: _: "${name}=flake:${name}") cfg.inputs-flakes;
};
};
}

View file

@ -18,10 +18,6 @@
inherit src;
loader = "raw";
}) 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 =
let
@ -47,6 +43,15 @@
getPkgs = system: builtins.mapAttrs (_: pkg: pkg.result.${system}) config.packages;
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"; };
base-packages = mkPackage (
{ symlinkJoin, system }:

View file

@ -1,6 +1,10 @@
{
lib,
stdenv,
pkgs,
system,
fenix,
crane,
src,
libiconv,
rocksdb,
@ -8,18 +12,27 @@
rustPlatform,
}:
let
manifest = (builtins.fromTOML (builtins.readFile "${src}/Cargo.toml")).package;
rust =
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
rustPlatform.buildRustPackage {
pname = manifest.name;
inherit (manifest) version;
crane'.buildPackage {
inherit src;
strictDeps = true;
useFetchCargoVendor = true;
cargoHash = "sha256-wESDxtKRMm/jyCr4kc20UuHGcE2s+OCMjfL+l1XihnA=";
nativeBuildInputs = [ rustPlatform.bindgenHook ];
buildInputs = lib.optionals stdenv.isDarwin [
@ -29,8 +42,8 @@ rustPlatform.buildRustPackage {
];
# Use system RocksDB
ROCKSDB_INCLUDE_DIR = "${rocksdb}/include";
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
ROCKSDB_INCLUDE_DIR = "${rocksdb'}/include";
ROCKSDB_LIB_DIR = "${rocksdb'}/lib";
NIX_OUTPATH_USED_AS_RANDOM_SEED = "randomseed";
CONDUIT_VERSION_EXTRA = src.shortRev;
}

View file

@ -1,8 +1,4 @@
{
config,
lib,
inputs,
}:
{ config }:
let
systems = [
"x86_64-linux"
@ -13,21 +9,16 @@ let
mkPackage = package: {
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
{
config.packages.conduit-next = {
inherit systems builder;
package = import ./conduit;
settings.args = {
src = inputs.conduit-src;
src = config.inputs.conduit-src.result;
crane = config.inputs.crane.result.mkLib;
fenix = config.inputs.fenix.result.packages;
};
};
@ -58,15 +49,4 @@ 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,8 +1,4 @@
{
lib,
config,
inputs,
}:
{ lib, config }:
let
systems = [
"x86_64-linux"
@ -11,8 +7,8 @@ let
];
wrappedPerSystem = lib.attrs.generate systems (
system:
inputs.wrapper-manager-hm-compat.lib {
pkgs = inputs.nixpkgs.legacyPackages.${system};
config.inputs.wrapper-manager-hm-compat.result.lib {
pkgs = config.inputs.nixpkgs.result.legacyPackages.${system};
modules = [
./starship
./helix
@ -21,7 +17,7 @@ let
./fish
./wezterm
];
specialArgs = { inherit inputs; };
specialArgs.inputs = builtins.mapAttrs (_: input: input.result) config.inputs;
}
);
wrappedPerSystem' = builtins.mapAttrs (_: wrapped: wrapped.config.build.packages) wrappedPerSystem;