This commit is contained in:
parent
f02ace1040
commit
26072b5cff
5 changed files with 101 additions and 79 deletions
14
flake-modules/dev-shell.nix
Normal file
14
flake-modules/dev-shell.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
perSystem =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
packages = with pkgs; [
|
||||||
|
just
|
||||||
|
lua-language-server
|
||||||
|
lua54Packages.luacheck
|
||||||
|
nixd
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
7
flake-modules/formatting.nix
Normal file
7
flake-modules/formatting.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
perSystem =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
formatter = pkgs.nixfmt-rfc-style;
|
||||||
|
};
|
||||||
|
}
|
47
flake-modules/nixos-configurations.nix
Normal file
47
flake-modules/nixos-configurations.nix
Normal 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"; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
21
flake-modules/packages.nix
Normal file
21
flake-modules/packages.nix
Normal 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 ]; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
81
flake.nix
81
flake.nix
|
@ -27,89 +27,22 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
inputs@{
|
inputs@{ flake-parts, ... }:
|
||||||
flake-parts,
|
|
||||||
nixpkgs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||||
flake =
|
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",
|
|
||||||
}:
|
|
||||||
nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
|
|
||||||
modules = [ ./hosts/${hostname}/configuration.nix ];
|
|
||||||
|
|
||||||
specialArgs = specialArgs // {
|
|
||||||
inherit hostname stateVersion system;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
homeManagerModules.default = import ./modules/home-manager;
|
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;
|
nixosModules.default = import ./modules/nixos;
|
||||||
|
|
||||||
overlays = import ./overlays { inherit inputs; };
|
overlays = import ./overlays { inherit inputs; };
|
||||||
};
|
};
|
||||||
|
|
||||||
perSystem =
|
imports = [
|
||||||
{ pkgs, system, ... }:
|
./flake-modules/dev-shell.nix
|
||||||
let
|
./flake-modules/formatting.nix
|
||||||
# TODO: refactor to use inputs' or similar.
|
./flake-modules/nixos-configurations.nix
|
||||||
nixvim = inputs.nixvim.legacyPackages.${system}.makeNixvimWithModule {
|
./flake-modules/packages.nix
|
||||||
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 ]; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systems = [ "x86_64-linux" ];
|
systems = [ "x86_64-linux" ];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue