use nixos lib
This commit is contained in:
72
flake.nix
72
flake.nix
@ -32,6 +32,7 @@
|
|||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
# Set overlays + unfree globally
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
@ -49,76 +50,31 @@
|
|||||||
# The rec expression turns a basic set into a set where self-referencing is possible.
|
# The rec expression turns a basic set into a set where self-referencing is possible.
|
||||||
# It is a shorthand for recursive and allows to use the values defined in this set from its own scope.
|
# It is a shorthand for recursive and allows to use the values defined in this set from its own scope.
|
||||||
in rec {
|
in rec {
|
||||||
# inherit lib;
|
|
||||||
|
|
||||||
# Local shell for NixFlake directory
|
# Local shell for NixFlake directory
|
||||||
devShells."${system}".default = import ./shell.nix { inherit pkgs; };
|
devShells."${system}".default = import ./shell.nix { inherit pkgs; };
|
||||||
|
|
||||||
# System configurations + HomeManager module
|
# System configurations + HomeManager module
|
||||||
# Accessible via 'nixos-rebuild'
|
# Accessible via 'nixos-rebuild'
|
||||||
# TODO: Add some sort of lib function to deduplicate the configs (they are mostly the same except for the modules)
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
|
|
||||||
# WIP using lib.my
|
|
||||||
nixinator = mylib.nixos.mkNixosConfig {
|
|
||||||
inherit system;
|
|
||||||
|
|
||||||
hostname = "nixinator";
|
|
||||||
extraModules = [ inputs.musnix.nixosModules.musnix ];
|
|
||||||
homeConfigs = [ mylib.nixos.mkHomeConfig { username = "christoph"; } ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# We give our configuration a name (the hostname) to choose a configuration when rebuilding.
|
# We give our configuration a name (the hostname) to choose a configuration when rebuilding.
|
||||||
# This makes it easy to add different configurations later (e.g. for a laptop).
|
# This makes it easy to add different configurations later (e.g. for a laptop).
|
||||||
# Usage: sudo nixos-rebuild switch --flake .#nixinator
|
# Usage: sudo nixos-rebuild switch --flake .#nixinator
|
||||||
# nixinator = nixpkgs.lib.nixosSystem {
|
nixinator = mylib.nixos.mkNixosConfig {
|
||||||
# inherit system;
|
inherit system;
|
||||||
#
|
|
||||||
# # Make our inputs available to the configuration.nix (for importing modules)
|
|
||||||
# specialArgs = { inherit inputs; };
|
|
||||||
#
|
|
||||||
# # >> Main NixOS configuration file <<
|
|
||||||
# modules = [
|
|
||||||
# { nixpkgs.pkgs = pkgs; }
|
|
||||||
#
|
|
||||||
# # TODO: Access this over inputs in configuration-nixtop.nix
|
|
||||||
# inputs.musnix.nixosModules.musnix
|
|
||||||
#
|
|
||||||
# ./nixos/configuration.nix
|
|
||||||
# ./nixos/configuration-nixinator.nix
|
|
||||||
#
|
|
||||||
# # HomeManager
|
|
||||||
# home-manager.nixosModules.home-manager
|
|
||||||
# {
|
|
||||||
# home-manager.useGlobalPkgs = true; # Use systems pkgs, disables nixpkgs.* options in home.nix
|
|
||||||
# home-manager.useUserPackages = true; # Enable installing packages through users.christoph.packages to /etc/profiles instead of ~/.nix-profile
|
|
||||||
# home-manager.users.christoph = import ./home/home-christoph.nix;
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
|
|
||||||
# nixtop = nixpkgs.lib.nixosSystem {
|
hostname = "nixinator";
|
||||||
# inherit system;
|
username = "christoph";
|
||||||
#
|
extraModules = [ inputs.musnix.nixosModules.musnix ];
|
||||||
# # Make our inputs available to the configuration.nix (for importing modules)
|
};
|
||||||
# specialArgs = { inherit inputs; };
|
|
||||||
#
|
nixtop = mylib.nixos.mkNixosConfig {
|
||||||
# # >> Main NixOS configuration file <<
|
inherit system;
|
||||||
# modules = [
|
|
||||||
# { nixpkgs.pkgs = pkgs; }
|
hostname = "nixtop";
|
||||||
#
|
username = "christoph";
|
||||||
# ./nixos/configuration.nix
|
};
|
||||||
# ./nixos/configuration-nixtop.nix
|
|
||||||
#
|
|
||||||
# # HomeManager
|
|
||||||
# home-manager.nixosModules.home-manager
|
|
||||||
# {
|
|
||||||
# home-manager.useGlobalPkgs = true; # Use systems pkgs, disables nixpkgs.* options in home.nix
|
|
||||||
# home-manager.useUserPackages = true; # Enable installing packages through users.christoph.packages
|
|
||||||
# home-manager.users.christoph = import ./home/home-christoph.nix;
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user