mirror of
https://github.com/sstent/vmimages.git
synced 2025-12-06 06:01:51 +00:00
sync
This commit is contained in:
224
flake.nix
224
flake.nix
@@ -54,129 +54,125 @@
|
||||
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
nixpkgs-unstable,
|
||||
...
|
||||
} @ inputs: let
|
||||
inherit (lib.my) mapModules mapModulesRec mapHosts;
|
||||
inherit (self) outputs;
|
||||
outputs =
|
||||
{ self
|
||||
, nixpkgs
|
||||
, home-manager
|
||||
, nixpkgs-unstable
|
||||
, ...
|
||||
} @ inputs:
|
||||
let
|
||||
inherit (lib.my) mapModules mapModulesRec mapHosts;
|
||||
inherit (self) outputs;
|
||||
|
||||
system = "x86_64-linux";
|
||||
system = "x86_64-linux";
|
||||
|
||||
mkPkgs = pkgs: extraOverlays:
|
||||
import pkgs {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true; # forgive me Stallman senpai
|
||||
overlays = extraOverlays ++ (lib.attrValues self.overlays);
|
||||
config.allowUnfree = true;
|
||||
overlays = builtins.attrValues self.overlays;
|
||||
};
|
||||
# pkgs = mkPkgs nixpkgs [self.overlay];
|
||||
pkgs = mkPkgs nixpkgs [];
|
||||
# pkgs' = mkPkgs nixpkgs-unstable [];
|
||||
|
||||
lib =
|
||||
nixpkgs.lib.extend
|
||||
(self: super:
|
||||
{
|
||||
my = import ./lib {
|
||||
inherit pkgs inputs outputs;
|
||||
lib = self;
|
||||
|
||||
lib =
|
||||
nixpkgs.lib.extend
|
||||
(self: super:
|
||||
{
|
||||
my = import ./lib {
|
||||
inherit pkgs inputs outputs;
|
||||
lib = self;
|
||||
};
|
||||
}
|
||||
// home-manager.lib);
|
||||
in
|
||||
{
|
||||
lib = lib.my;
|
||||
packages."${system}" = mapModules ./pkgs (p: pkgs.callPackage p { });
|
||||
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
|
||||
|
||||
devShell."${system}" =
|
||||
import ./shell.nix { inherit pkgs; };
|
||||
|
||||
|
||||
##Loads all overlays in the default.nix
|
||||
##This gets used as an input to the pkg definitiosn
|
||||
overlays = import ./overlays { inherit inputs; };
|
||||
|
||||
# Output all NixOS modules in ./modules/nixos to flake. Modules should be in
|
||||
# individual subdirectories and contain a default.nix file
|
||||
nixosModules = builtins.listToAttrs (map
|
||||
(x: {
|
||||
name = x;
|
||||
value = import (./modules/nixos + "/${x}");
|
||||
})
|
||||
(builtins.attrNames (builtins.readDir ./modules/nixos)));
|
||||
|
||||
##import our HM modulesin ./modules/home-manager to flake. Modules should be in
|
||||
# individual subdirectories and contain a default.nix file
|
||||
homeManagerModules = builtins.listToAttrs (map
|
||||
(name: {
|
||||
inherit name;
|
||||
value = import (./modules/home-manager + "/${name}");
|
||||
})
|
||||
(builtins.attrNames (builtins.readDir ./modules/home-manager)));
|
||||
|
||||
# nixosConfigurations =
|
||||
# mapHosts ./hosts {};
|
||||
|
||||
# NixOS configuration entrypoint
|
||||
nixosConfigurations = {
|
||||
go3-wsl = nixpkgs.lib.nixosSystem {
|
||||
pkgs = pkgs;
|
||||
specialArgs = {
|
||||
inherit inputs outputs lib;
|
||||
hostName = "go3-wsl";
|
||||
};
|
||||
}
|
||||
// home-manager.lib);
|
||||
in {
|
||||
lib = lib.my;
|
||||
packages."${system}" = mapModules ./pkgs (p: pkgs.callPackage p {});
|
||||
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
|
||||
|
||||
devShell."${system}" =
|
||||
import ./shell.nix {inherit pkgs;};
|
||||
|
||||
# overlay = final: prev: {
|
||||
# unstable = pkgs';
|
||||
# my = self.packages."${system}";
|
||||
# keybase = pkgs'.keybase;
|
||||
# };
|
||||
|
||||
overlays = import ./overlays {inherit inputs;};
|
||||
|
||||
# Output all modules in ./modules to flake. Modules should be in
|
||||
# individual subdirectories and contain a default.nix file
|
||||
nixosModules = builtins.listToAttrs (map
|
||||
(x: {
|
||||
name = x;
|
||||
value = import (./modules/nixos + "/${x}");
|
||||
})
|
||||
(builtins.attrNames (builtins.readDir ./modules/nixos)));
|
||||
|
||||
##import our HM modules
|
||||
## -- imported in ./home-manger/general
|
||||
|
||||
homeManagerModules = builtins.listToAttrs (map
|
||||
(name: {
|
||||
inherit name;
|
||||
value = import (./modules/home-manager + "/${name}");
|
||||
})
|
||||
(builtins.attrNames (builtins.readDir ./modules/home-manager)));
|
||||
|
||||
# nixosConfigurations =
|
||||
# mapHosts ./hosts {};
|
||||
|
||||
# NixOS configuration entrypoint
|
||||
# Available through 'nixos-rebuild --flake .#your-hostname'
|
||||
nixosConfigurations = {
|
||||
go3-wsl = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit inputs outputs lib;
|
||||
hostName = "go3-wsl";
|
||||
modules = [
|
||||
./hosts/go3-wsl
|
||||
];
|
||||
};
|
||||
StuPC-WSL = nixpkgs.lib.nixosSystem {
|
||||
pkgs = pkgs;
|
||||
specialArgs = {
|
||||
inherit inputs outputs lib;
|
||||
hostName = "StuPC";
|
||||
};
|
||||
modules = [
|
||||
./hosts/StuPC-WSL
|
||||
];
|
||||
};
|
||||
modules = [
|
||||
./hosts/go3-wsl
|
||||
];
|
||||
};
|
||||
StuPC-WSL = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit inputs outputs lib;
|
||||
hostName = "StuPC";
|
||||
|
||||
# Standalone home-manager configuration entrypoint
|
||||
# Available through 'home-manager --flake .#your-username@your-hostname'
|
||||
homeConfigurations = {
|
||||
# FIXME replace with your username@hostname
|
||||
"sstent@go3-wsl" = home-manager.lib.homeManagerConfiguration {
|
||||
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
pkgs = pkgs;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs lib;
|
||||
hostName = "go3-wsl";
|
||||
};
|
||||
modules = [
|
||||
# > Our main home-manager configuration file <
|
||||
./home-manager/users/sstent
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
];
|
||||
};
|
||||
"sstent@StuPC-WSL" = home-manager.lib.homeManagerConfiguration {
|
||||
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
pkgs = pkgs;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs lib;
|
||||
hostName = "StuPC-WSL";
|
||||
};
|
||||
modules = [
|
||||
# > Our main home-manager configuration file <
|
||||
./home-manager/users/sstent
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
];
|
||||
};
|
||||
modules = [
|
||||
./hosts/StuPC-WSL
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Standalone home-manager configuration entrypoint
|
||||
# Available through 'home-manager --flake .#your-username@your-hostname'
|
||||
homeConfigurations = {
|
||||
# FIXME replace with your username@hostname
|
||||
"sstent@go3-wsl" = home-manager.lib.homeManagerConfiguration {
|
||||
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
pkgs = pkgs;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs lib;
|
||||
hostName = "go3-wsl";
|
||||
};
|
||||
modules = [
|
||||
# > Our main home-manager configuration file <
|
||||
./home-manager/users/sstent
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
];
|
||||
};
|
||||
"sstent@StuPC-WSL" = home-manager.lib.homeManagerConfiguration {
|
||||
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
pkgs = pkgs;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs lib;
|
||||
hostName = "StuPC-WSL";
|
||||
};
|
||||
modules = [
|
||||
# > Our main home-manager configuration file <
|
||||
./home-manager/users/sstent
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user