Extract flake modules
All checks were successful
/ check (push) Successful in 1m28s

This commit is contained in:
Oliver Davies 2025-07-09 02:12:31 +01:00
parent f02ace1040
commit 26072b5cff
5 changed files with 101 additions and 79 deletions

View file

@ -0,0 +1,14 @@
{
perSystem =
{ pkgs, ... }:
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [
just
lua-language-server
lua54Packages.luacheck
nixd
];
};
};
}

View file

@ -0,0 +1,7 @@
{
perSystem =
{ pkgs, ... }:
{
formatter = pkgs.nixfmt-rfc-style;
};
}

View file

@ -0,0 +1,47 @@
{ inputs, self, ... }:
{
flake =
let
inherit (self) outputs;
specialArgs = {
inherit inputs outputs self;
system = "x86_64-linux";
username = "opdavies";
};
mkNixosConfiguration =
{
hostname,
stateVersion ? "22.11",
system ? "x86_64-linux",
}:
inputs.nixpkgs.lib.nixosSystem {
inherit system;
modules = [ "${self}/hosts/${hostname}/configuration.nix" ];
specialArgs = specialArgs // {
inherit hostname stateVersion system;
};
};
in
{
nixosConfigurations = {
lemp11 = mkNixosConfiguration { hostname = "lemp11"; };
nixedo = mkNixosConfiguration {
hostname = "nixedo";
stateVersion = "24.11";
};
t480 = mkNixosConfiguration { hostname = "t480"; };
t490 = mkNixosConfiguration { hostname = "t490"; };
PW05CH3L = mkNixosConfiguration { hostname = "PW05CH3L"; };
};
};
}

View file

@ -0,0 +1,21 @@
{ inputs, self, ... }:
{
perSystem =
{ pkgs, system, ... }:
let
# TODO: refactor to use inputs' or similar.
nixvim = inputs.nixvim.legacyPackages.${system}.makeNixvimWithModule {
inherit pkgs;
module = import "${self}/modules/home-manager/coding/neovim/config";
};
in
{
packages = {
inherit nixvim;
default = pkgs.mkShell { buildInputs = with pkgs; [ just ]; };
};
};
}

View file

@ -27,89 +27,22 @@
};
outputs =
inputs@{
flake-parts,
nixpkgs,
self,
...
}:
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
flake =
let
inherit (self) outputs;
flake = {
homeManagerModules.default = import ./modules/home-manager;
specialArgs = {
inherit inputs outputs self;
nixosModules.default = import ./modules/nixos;
system = "x86_64-linux";
username = "opdavies";
};
overlays = import ./overlays { inherit inputs; };
};
mkNixosConfiguration =
{
hostname,
stateVersion ? "22.11",
system ? "x86_64-linux",
}:
nixpkgs.lib.nixosSystem {
inherit system;
modules = [ ./hosts/${hostname}/configuration.nix ];
specialArgs = specialArgs // {
inherit hostname stateVersion system;
};
};
in
{
homeManagerModules.default = import ./modules/home-manager;
nixosConfigurations = {
lemp11 = mkNixosConfiguration { hostname = "lemp11"; };
nixedo = mkNixosConfiguration {
hostname = "nixedo";
stateVersion = "24.11";
};
t480 = mkNixosConfiguration { hostname = "t480"; };
t490 = mkNixosConfiguration { hostname = "t490"; };
PW05CH3L = mkNixosConfiguration { hostname = "PW05CH3L"; };
};
nixosModules.default = import ./modules/nixos;
overlays = import ./overlays { inherit inputs; };
};
perSystem =
{ pkgs, system, ... }:
let
# TODO: refactor to use inputs' or similar.
nixvim = inputs.nixvim.legacyPackages.${system}.makeNixvimWithModule {
inherit pkgs;
module = import ./modules/home-manager/coding/neovim/config;
};
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [
just
lua-language-server
lua54Packages.luacheck
nixd
];
};
formatter = pkgs.nixfmt-rfc-style;
packages = {
inherit nixvim;
default = pkgs.mkShell { buildInputs = with pkgs; [ just ]; };
};
};
imports = [
./flake-modules/dev-shell.nix
./flake-modules/formatting.nix
./flake-modules/nixos-configurations.nix
./flake-modules/packages.nix
];
systems = [ "x86_64-linux" ];
};