Compare commits
1 commit
5e7e6eb917
...
9a2c0fed2c
Author | SHA1 | Date | |
---|---|---|---|
9a2c0fed2c |
5 changed files with 82 additions and 46 deletions
53
flake.nix
53
flake.nix
|
@ -1,5 +1,34 @@
|
||||||
{
|
{
|
||||||
outputs = inputs: (import ./nilla.nix { inherit inputs; }).flake;
|
outputs =
|
||||||
|
inputs:
|
||||||
|
let
|
||||||
|
nilla = import ./nilla.nix { inherit inputs; };
|
||||||
|
systems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-linux"
|
||||||
|
"aarch64-darwin"
|
||||||
|
];
|
||||||
|
# NOTE: Assumes every package is available for every system.
|
||||||
|
# For now let's say this is always the case.
|
||||||
|
transpose =
|
||||||
|
attrs:
|
||||||
|
let
|
||||||
|
inherit (inputs.nixpkgs) lib;
|
||||||
|
mappedForSystem = system: builtins.mapAttrs (_: pkg: pkg.result.${system}) attrs;
|
||||||
|
in
|
||||||
|
lib.genAttrs systems mappedForSystem;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit (nilla) nixosModules;
|
||||||
|
inherit (nilla) darwinModules;
|
||||||
|
inherit (nilla) homeModules;
|
||||||
|
inherit (nilla) nixosConfigurations;
|
||||||
|
inherit (nilla) darwinConfigurations;
|
||||||
|
inherit (nilla) homeConfigurations;
|
||||||
|
devShells = transpose nilla.shells;
|
||||||
|
packages = transpose nilla.packages;
|
||||||
|
formatter = nilla.packages.formatter.result;
|
||||||
|
};
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable";
|
||||||
|
@ -99,4 +128,26 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
TODO: Uncomment once (if ever?) nixConfig makes sense in flakes
|
||||||
|
nixConfig = {
|
||||||
|
extra-substituters = [
|
||||||
|
"https://hyprland.cachix.org"
|
||||||
|
"https://cache.garnix.io"
|
||||||
|
"https://nix-community.cachix.org"
|
||||||
|
"https://hercules-ci.cachix.org"
|
||||||
|
"https://nrabulinski.cachix.org"
|
||||||
|
"https://cache.nrab.lol"
|
||||||
|
];
|
||||||
|
extra-trusted-public-keys = [
|
||||||
|
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||||
|
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
|
||||||
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
|
"hercules-ci.cachix.org-1:ZZeDl9Va+xe9j+KqdzoBZMFJHVQ42Uu/c/1/KMC5Lw0="
|
||||||
|
"nrabulinski.cachix.org-1:Q5FD7+1c68uH74CQK66UWNzxhanZW8xcg1LFXxGK8ic="
|
||||||
|
"cache.nrab.lol-1:CJl1TouOyuJ1Xh4tZSXLwm3Upt06HzUNZmeyuEB9EZg="
|
||||||
|
];
|
||||||
|
};
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,14 +26,28 @@ in
|
||||||
settei = inputs.self;
|
settei = inputs.self;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
baseNixos = inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
modules = [
|
||||||
|
config.nixosModules.combined
|
||||||
|
sharedOptions
|
||||||
|
];
|
||||||
|
specialArgs.configurationName = "base";
|
||||||
|
};
|
||||||
|
|
||||||
|
baseDarwin = inputs.darwin.lib.darwinSystem {
|
||||||
|
modules = [
|
||||||
|
config.darwinModules.combined
|
||||||
|
sharedOptions
|
||||||
|
];
|
||||||
|
specialArgs.configurationName = "base";
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixos =
|
nixos =
|
||||||
name: module:
|
name: module:
|
||||||
inputs.nixpkgs.lib.nixosSystem {
|
baseNixos.extendModules {
|
||||||
modules = [
|
modules = [
|
||||||
config.nixosModules.combined
|
|
||||||
sharedOptions
|
|
||||||
module
|
module
|
||||||
config.extraHostConfigs.${name} or { }
|
config.extraHostConfigs.${name} or { }
|
||||||
];
|
];
|
||||||
|
@ -42,14 +56,18 @@ in
|
||||||
|
|
||||||
darwin =
|
darwin =
|
||||||
name: module:
|
name: module:
|
||||||
inputs.darwin.lib.darwinSystem {
|
let
|
||||||
modules = [
|
eval = baseDarwin._module.args.extendModules {
|
||||||
config.darwinModules.combined
|
modules = [
|
||||||
sharedOptions
|
module
|
||||||
module
|
config.extraHostConfigs.${name} or { }
|
||||||
config.extraHostConfigs.${name} or { }
|
];
|
||||||
];
|
specialArgs.configurationName = name;
|
||||||
specialArgs.configurationName = name;
|
};
|
||||||
|
in
|
||||||
|
eval
|
||||||
|
// {
|
||||||
|
system = eval.config.system.build.toplevel;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,5 +11,4 @@ let
|
||||||
useBuiltinsFetchTree = true;
|
useBuiltinsFetchTree = true;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
# Workaround for https://github.com/nilla-nix/nilla/issues/14
|
flake.inputs
|
||||||
builtins.mapAttrs (_: input: input // { type = "derivation"; }) flake.inputs
|
|
||||||
|
|
|
@ -4,6 +4,5 @@
|
||||||
./services.nix
|
./services.nix
|
||||||
./configurations.nix
|
./configurations.nix
|
||||||
./modules.nix
|
./modules.nix
|
||||||
./flake.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
{ lib, config }:
|
|
||||||
let
|
|
||||||
systems = [
|
|
||||||
"x86_64-linux"
|
|
||||||
"aarch64-linux"
|
|
||||||
"aarch64-darwin"
|
|
||||||
];
|
|
||||||
transpose =
|
|
||||||
attrs: lib.attrs.generate systems (system: builtins.mapAttrs (_: pkg: pkg.result.${system}) attrs);
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.flake = lib.options.create {
|
|
||||||
type = lib.types.attrs.of lib.types.raw;
|
|
||||||
};
|
|
||||||
|
|
||||||
config.flake = {
|
|
||||||
inherit (config)
|
|
||||||
nixosModules
|
|
||||||
darwinModules
|
|
||||||
homeModules
|
|
||||||
nixosConfigurations
|
|
||||||
darwinConfigurations
|
|
||||||
homeConfigurations
|
|
||||||
;
|
|
||||||
|
|
||||||
devShells = transpose config.shells;
|
|
||||||
packages = transpose config.packages;
|
|
||||||
|
|
||||||
formatter = config.packages.formatter.result;
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue