migration to flake-parts
This commit is contained in:
79
flake.nix
79
flake.nix
@@ -1,6 +1,8 @@
|
||||
{
|
||||
description = "JawZ NixOS flake setup";
|
||||
|
||||
inputs = {
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.05";
|
||||
nixpkgs-small.url = "github:nixos/nixpkgs?ref=nixos-25.05-small";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
@@ -59,76 +61,13 @@
|
||||
};
|
||||
};
|
||||
outputs =
|
||||
{ self, jawz-scripts, ... }@inputs:
|
||||
let
|
||||
inherit (self) outputs;
|
||||
system = "x86_64-linux";
|
||||
mkpkgs =
|
||||
repo:
|
||||
import repo {
|
||||
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
|
||||
inputs:
|
||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
imports = [
|
||||
./parts/core.nix
|
||||
./parts/hosts.nix
|
||||
./parts/packages.nix
|
||||
./parts/devshells.nix
|
||||
];
|
||||
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
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user