Refactoring
This commit is contained in:
parent
fb335d75b3
commit
64fcff10aa
4 changed files with 60 additions and 23 deletions
35
flake.nix
35
flake.nix
|
|
@ -10,10 +10,10 @@
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
nixvim = {
|
# nixvim = {
|
||||||
url = "github:nix-community/nixvim";
|
# url = "github:nix-community/nixvim";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
# inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
# };
|
||||||
nixvim-config = {
|
nixvim-config = {
|
||||||
type = "gitlab";
|
type = "gitlab";
|
||||||
owner = "MFlossmann";
|
owner = "MFlossmann";
|
||||||
|
|
@ -31,24 +31,35 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {...} @ inputs: let
|
outputs = {
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
...
|
||||||
|
} @ inputs: let
|
||||||
# basic boilerplate-reducing lib with a bunch of functions
|
# basic boilerplate-reducing lib with a bunch of functions
|
||||||
helperLib = import ./helperLib/default.nix {inherit inputs;};
|
helperLib = import ./helperLib/default.nix {inherit inputs;};
|
||||||
in
|
nixvim_config = inputs.nixvim_config;
|
||||||
with helperLib; {
|
in {
|
||||||
|
packages = helperLib.forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
|
||||||
|
|
||||||
|
formatter = helperLib.forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
|
||||||
|
|
||||||
|
overlays = import ./overlays {inherit inputs;};
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
remus = mkSystem ./hosts/remus/configuration.nix;
|
remus = helperLib.mkSystem ./hosts/remus/configuration.nix;
|
||||||
};
|
};
|
||||||
|
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
"prunebutt@remus" = mkHome "x86_64-linux" ./hosts/remus/home.nix;
|
"prunebutt@remus" = helperLib.mkHome "x86_64-linux" ./hosts/remus/home.nix;
|
||||||
};
|
};
|
||||||
|
|
||||||
homeManagerModules.default = ./modules/home;
|
homeManagerModules.default = ./modules/home;
|
||||||
nixosModules.default = ./modules/nixOS;
|
nixosModules.default = ./modules/nixOS;
|
||||||
|
|
||||||
overlays.additions = final: _prev: {
|
# overlays.additions =
|
||||||
nixvim = nixvim-config.packages.${_prev.system}.default;
|
# (final: prev: {
|
||||||
};
|
# neovim = nixvim_config.packages.${prev.system}.default;
|
||||||
|
# });
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,11 @@ in rec {
|
||||||
inherit inputs outputs helperLib;
|
inherit inputs outputs helperLib;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-stable ]; })
|
({
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {nixpkgs.overlays = [overlay-stable];})
|
||||||
config
|
config
|
||||||
outputs.nixosModules.default
|
outputs.nixosModules.default
|
||||||
];
|
];
|
||||||
|
|
@ -38,7 +42,11 @@ in rec {
|
||||||
inherit inputs helperLib outputs;
|
inherit inputs helperLib outputs;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
({ config, pkgs, ...}: { nixpkgs.overlays = [ overlay-stable ]; })
|
({
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {nixpkgs.overlays = [overlay-stable];})
|
||||||
config
|
config
|
||||||
outputs.homeManagerModules.default
|
outputs.homeManagerModules.default
|
||||||
];
|
];
|
||||||
|
|
@ -101,12 +109,13 @@ in rec {
|
||||||
modules;
|
modules;
|
||||||
|
|
||||||
# ============================ Shell ============================= #
|
# ============================ Shell ============================= #
|
||||||
forAllSystems = pkgs:
|
forAllSystems =
|
||||||
|
# pkgs:
|
||||||
inputs.nixpkgs.lib.genAttrs [
|
inputs.nixpkgs.lib.genAttrs [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
"aarch64-linux"
|
"aarch64-linux"
|
||||||
"x86_64-darwin"
|
"x86_64-darwin"
|
||||||
"aarch64-darwin"
|
"aarch64-darwin"
|
||||||
]
|
];
|
||||||
(system: pkgs inputs.nixpkgs.legacyPackages.${system});
|
# (system: pkgs inputs.nixpkgs.legacyPackages.${system});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
overlays/default.nix
Normal file
12
overlays/default.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
{inputs, ...}: {
|
||||||
|
# This one brings our custom packages from the `pkgs` directory
|
||||||
|
additions = final: _prev: import ../pkgs final.pkgs;
|
||||||
|
|
||||||
|
# Any custom modifications
|
||||||
|
# https://nixos.wiki/wiki/Overlays
|
||||||
|
modifications = final: prev: {
|
||||||
|
# example = prev.example.overrideAttrs (oldAttrs: rec {
|
||||||
|
# ...
|
||||||
|
# });
|
||||||
|
};
|
||||||
|
}
|
||||||
5
pkgs/default.nix
Normal file
5
pkgs/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Custom packages, that can be defined similarly to ones from nixpkgks
|
||||||
|
# Build them using `nix build .#example`
|
||||||
|
pkgs: {
|
||||||
|
# example = pkgs.callPackage ./example { };
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue