migration to flake-parts
This commit is contained in:
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