migration to flake-parts
This commit is contained in:
46
flake.lock
generated
46
flake.lock
generated
@@ -232,6 +232,24 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": "nixpkgs-lib_2"
|
"nixpkgs-lib": "nixpkgs-lib_2"
|
||||||
},
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1759362264,
|
||||||
|
"narHash": "sha256-wfG0S7pltlYyZTM+qqlhJ7GMw2fTF4mLKCIVhLii/4M=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "758cf7296bee11f1706a574c77d072b8a7baa881",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-parts_3": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": "nixpkgs-lib_3"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1712014858,
|
"lastModified": 1712014858,
|
||||||
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
|
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
|
||||||
@@ -245,7 +263,7 @@
|
|||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-parts_3": {
|
"flake-parts_4": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
"nur",
|
"nur",
|
||||||
@@ -266,7 +284,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-parts_4": {
|
"flake-parts_5": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
"stylix",
|
"stylix",
|
||||||
@@ -681,7 +699,7 @@
|
|||||||
},
|
},
|
||||||
"nix-gaming": {
|
"nix-gaming": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts_2",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
@@ -768,6 +786,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-lib_2": {
|
"nixpkgs-lib_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1754788789,
|
||||||
|
"narHash": "sha256-x2rJ+Ovzq0sCMpgfgGaaqgBSwY+LST+WbZ6TytnT9Rk=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"rev": "a73b9c743612e4244d865a2fdee11865283c04e6",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-lib_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "lib",
|
"dir": "lib",
|
||||||
"lastModified": 1711703276,
|
"lastModified": 1711703276,
|
||||||
@@ -835,7 +868,7 @@
|
|||||||
},
|
},
|
||||||
"nixtendo-switch": {
|
"nixtendo-switch": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts_2",
|
"flake-parts": "flake-parts_3",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
@@ -856,7 +889,7 @@
|
|||||||
},
|
},
|
||||||
"nur": {
|
"nur": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts_3",
|
"flake-parts": "flake-parts_4",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
@@ -943,6 +976,7 @@
|
|||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"doom-emacs": "doom-emacs",
|
"doom-emacs": "doom-emacs",
|
||||||
|
"flake-parts": "flake-parts",
|
||||||
"fonts": "fonts",
|
"fonts": "fonts",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"hyprland": "hyprland",
|
"hyprland": "hyprland",
|
||||||
@@ -988,7 +1022,7 @@
|
|||||||
"base16-helix": "base16-helix",
|
"base16-helix": "base16-helix",
|
||||||
"base16-vim": "base16-vim",
|
"base16-vim": "base16-vim",
|
||||||
"firefox-gnome-theme": "firefox-gnome-theme",
|
"firefox-gnome-theme": "firefox-gnome-theme",
|
||||||
"flake-parts": "flake-parts_4",
|
"flake-parts": "flake-parts_5",
|
||||||
"gnome-shell": "gnome-shell",
|
"gnome-shell": "gnome-shell",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
|
|||||||
79
flake.nix
79
flake.nix
@@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
description = "JawZ NixOS flake setup";
|
description = "JawZ NixOS flake setup";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.05";
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.05";
|
||||||
nixpkgs-small.url = "github:nixos/nixpkgs?ref=nixos-25.05-small";
|
nixpkgs-small.url = "github:nixos/nixpkgs?ref=nixos-25.05-small";
|
||||||
nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||||
@@ -59,76 +61,13 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
outputs =
|
outputs =
|
||||||
{ self, jawz-scripts, ... }@inputs:
|
inputs:
|
||||||
let
|
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||||
inherit (self) outputs;
|
imports = [
|
||||||
system = "x86_64-linux";
|
./parts/core.nix
|
||||||
mkpkgs =
|
./parts/hosts.nix
|
||||||
repo:
|
./parts/packages.nix
|
||||||
import repo {
|
./parts/devshells.nix
|
||||||
inherit system;
|
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
langList = builtins.filter (name: name != "emacs") (
|
|
||||||
builtins.map (file: builtins.replaceStrings [ ".nix" ] [ "" ] (baseNameOf file)) (
|
|
||||||
builtins.attrNames (builtins.readDir ./modules/dev)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
commonModules = name: [
|
|
||||||
{
|
|
||||||
nixpkgs.overlays = [
|
|
||||||
(import ./config/overlay.nix { inherit mkpkgs inputs; })
|
|
||||||
inputs.doom-emacs.overlays.default
|
|
||||||
];
|
];
|
||||||
}
|
|
||||||
{
|
|
||||||
nix.registry = {
|
|
||||||
jawz.flake = self;
|
|
||||||
unstable.flake = inputs.nixpkgs-unstable;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
./hosts/${name}/configuration.nix
|
|
||||||
inputs.nur.modules.nixos.default
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
inputs.stylix.nixosModules.stylix
|
|
||||||
inputs.nixtendo-switch.nixosModules.nixtendo-switch
|
|
||||||
];
|
|
||||||
createConfig =
|
|
||||||
name: local-nixpkgs:
|
|
||||||
let
|
|
||||||
lib = local-nixpkgs.lib // inputs.home-manager.lib;
|
|
||||||
in
|
|
||||||
lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
specialArgs = {
|
|
||||||
inherit inputs outputs;
|
|
||||||
};
|
|
||||||
modules = commonModules name;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
nixosConfigurations = {
|
|
||||||
workstation = createConfig "workstation" inputs.nixpkgs;
|
|
||||||
miniserver = createConfig "miniserver" inputs.nixpkgs-small;
|
|
||||||
server = createConfig "server" inputs.nixpkgs-small;
|
|
||||||
galaxy = createConfig "galaxy" inputs.nixpkgs-small;
|
|
||||||
emacs = createConfig "emacs" inputs.nixpkgs;
|
|
||||||
};
|
|
||||||
packages.${system} = (jawz-scripts.packages.${system} or { }) // {
|
|
||||||
emacs-vm = inputs.nixos-generators.nixosGenerate {
|
|
||||||
inherit system;
|
|
||||||
specialArgs = {
|
|
||||||
inherit inputs outputs;
|
|
||||||
};
|
|
||||||
modules = commonModules "emacs";
|
|
||||||
format = "vm";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
devShells.${system} = builtins.listToAttrs (
|
|
||||||
map (name: {
|
|
||||||
inherit name;
|
|
||||||
value = self.nixosConfigurations.emacs.config.devShells.${name};
|
|
||||||
}) langList
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
54
parts/core.nix
Normal file
54
parts/core.nix
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
{ inputs, ... }:
|
||||||
|
let
|
||||||
|
system = "x86_64-linux";
|
||||||
|
mkpkgs =
|
||||||
|
repo:
|
||||||
|
import repo {
|
||||||
|
inherit system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
systems = [ system ];
|
||||||
|
flake = {
|
||||||
|
lib = {
|
||||||
|
commonModules = name: [
|
||||||
|
../hosts/${name}/configuration.nix
|
||||||
|
inputs.nur.modules.nixos.default
|
||||||
|
inputs.sops-nix.nixosModules.sops
|
||||||
|
inputs.stylix.nixosModules.stylix
|
||||||
|
inputs.nixtendo-switch.nixosModules.nixtendo-switch
|
||||||
|
{
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(import ../config/overlay.nix { inherit mkpkgs inputs; })
|
||||||
|
inputs.doom-emacs.overlays.default
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
nix.registry = {
|
||||||
|
jawz.flake = inputs.self;
|
||||||
|
unstable.flake = inputs.nixpkgs-unstable;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
createConfig =
|
||||||
|
name: local-nixpkgs:
|
||||||
|
let
|
||||||
|
lib = local-nixpkgs.lib // inputs.home-manager.lib;
|
||||||
|
in
|
||||||
|
lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = inputs.self.lib.commonModules name;
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs;
|
||||||
|
outputs = inputs.self;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
langList =
|
||||||
|
builtins.readDir ../modules/dev
|
||||||
|
|> builtins.attrNames
|
||||||
|
|> map (file: baseNameOf file |> builtins.replaceStrings [ ".nix" ] [ "" ])
|
||||||
|
|> builtins.filter (name: name != "emacs");
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
12
parts/devshells.nix
Normal file
12
parts/devshells.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
perSystem = _: {
|
||||||
|
devShells =
|
||||||
|
inputs.self.lib.langList
|
||||||
|
|> map (name: {
|
||||||
|
inherit name;
|
||||||
|
value = inputs.self.nixosConfigurations.emacs.config.devShells.${name};
|
||||||
|
})
|
||||||
|
|> builtins.listToAttrs;
|
||||||
|
};
|
||||||
|
}
|
||||||
10
parts/hosts.nix
Normal file
10
parts/hosts.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
flake.nixosConfigurations = {
|
||||||
|
workstation = inputs.self.lib.createConfig "workstation" inputs.nixpkgs;
|
||||||
|
miniserver = inputs.self.lib.createConfig "miniserver" inputs.nixpkgs-small;
|
||||||
|
server = inputs.self.lib.createConfig "server" inputs.nixpkgs-small;
|
||||||
|
galaxy = inputs.self.lib.createConfig "galaxy" inputs.nixpkgs-small;
|
||||||
|
emacs = inputs.self.lib.createConfig "emacs" inputs.nixpkgs;
|
||||||
|
};
|
||||||
|
}
|
||||||
18
parts/packages.nix
Normal file
18
parts/packages.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
perSystem =
|
||||||
|
{ system, ... }:
|
||||||
|
{
|
||||||
|
packages = (inputs.jawz-scripts.packages.${system} or { }) // {
|
||||||
|
emacs-vm = inputs.nixos-generators.nixosGenerate {
|
||||||
|
inherit system;
|
||||||
|
modules = inputs.self.lib.commonModules "emacs";
|
||||||
|
format = "vm";
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs;
|
||||||
|
outputs = inputs.self;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user