mirror of
https://github.com/sstent/vmimages.git
synced 2025-12-06 06:01:51 +00:00
sync
This commit is contained in:
67
flake.nix
67
flake.nix
@@ -28,6 +28,7 @@
|
||||
vscode-server.url = "github:msteen/nixos-vscode-server";
|
||||
|
||||
# homeage = {url = "github:jordanisaacs/homeage"; inputs.nixpkgs.follows = "nixpkgs";};
|
||||
# Nix Library Functions
|
||||
library = {
|
||||
type = "github";
|
||||
owner = "nix-community";
|
||||
@@ -35,71 +36,47 @@
|
||||
ref = "master";
|
||||
rev = "af5239f892ae6e1c8bb560b11ed874cebbd10696";
|
||||
};
|
||||
|
||||
# Source Filter Functions
|
||||
filter.url = "github:numtide/nix-filter";
|
||||
ignore = {
|
||||
url = "github:hercules-ci/gitignore.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Flake Utility Functions
|
||||
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
|
||||
|
||||
|
||||
};
|
||||
outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, home-manager,... }:
|
||||
|
||||
outputs = { self, nixpkgs, home-manager,library, ignore, filter,... }@inputs:
|
||||
let
|
||||
inherit (lib.my) mapModules mapModulesRec mapHosts;
|
||||
inherit (self) outputs;
|
||||
forEachSystem = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ];
|
||||
platforms = ["x86_64-linux"];
|
||||
|
||||
forEachPkgs = f: forEachSystem (sys: f nixpkgs.legacyPackages.${sys});
|
||||
|
||||
# outputs = { self, nixpkgs, home-manager, ignore, filter, library,... }@inputs:
|
||||
system = "x86_64-linux";
|
||||
|
||||
mkPkgs = pkgs: extraOverlays: import pkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true; # forgive me Stallman senpai
|
||||
overlays = extraOverlays ++ (lib.attrValues self.overlays);
|
||||
};
|
||||
pkgs = mkPkgs nixpkgs [ self.overlay ];
|
||||
pkgs' = mkPkgs nixpkgs-unstable [];
|
||||
|
||||
lib = nixpkgs.lib.extend
|
||||
(self: super: { my = import ./lib { inherit pkgs inputs; lib = self; }; });
|
||||
in {
|
||||
lib = lib.my;
|
||||
|
||||
overlay =
|
||||
final: prev: {
|
||||
unstable = pkgs';
|
||||
my = self.packages."${system}";
|
||||
};
|
||||
|
||||
overlays =
|
||||
mapModules ./overlays import;
|
||||
|
||||
packages."${system}" =
|
||||
mapModules ./packages (p: pkgs.callPackage p {});
|
||||
|
||||
nixosModules =
|
||||
{ dotfiles = import ./.; } // mapModulesRec ./modules import;
|
||||
|
||||
# packages = forEachPkgs (pkgs: import ./pkgs { inherit pkgs; });
|
||||
# devShells = forEachPkgs (pkgs: import ./shell.nix { inherit pkgs; });
|
||||
devShell."${system}" =
|
||||
import ./shell.nix { inherit pkgs; };
|
||||
|
||||
# overlays = import ./overlays { inherit inputs; };
|
||||
# nixosModules = import ./modules/nixos;
|
||||
in
|
||||
rec {
|
||||
packages = forEachPkgs (pkgs: import ./pkgs { inherit pkgs; });
|
||||
devShells = forEachPkgs (pkgs: import ./shell.nix { inherit pkgs; });
|
||||
overlays = import ./overlays { inherit inputs; };
|
||||
nixosModules = import ./modules/nixos;
|
||||
homeManagerModules = import ./modules/home-manager;
|
||||
|
||||
|
||||
# NixOS configuration entrypoint
|
||||
# Available through 'nixos-rebuild --flake .#your-hostname'
|
||||
nixosConfigurations = {
|
||||
Go3 = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs ; };
|
||||
specialArgs = { inherit inputs outputs; };
|
||||
modules = [
|
||||
./hosts/WSL/Go3
|
||||
];
|
||||
};
|
||||
StuPC = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs ; };
|
||||
specialArgs = { inherit inputs outputs; };
|
||||
modules = [
|
||||
./hosts/WSL/StuPC
|
||||
];
|
||||
@@ -113,7 +90,7 @@
|
||||
# FIXME replace with your username@hostname
|
||||
"sstent@Go3" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
extraSpecialArgs = { inherit inputs lib; hostName = "Go3"; };
|
||||
extraSpecialArgs = { inherit inputs outputs; hostName = "Go3"; };
|
||||
modules = [
|
||||
# > Our main home-manager configuration file <
|
||||
./home-manager/users/sstent
|
||||
@@ -122,7 +99,7 @@
|
||||
};
|
||||
"sstent@StuPC" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
extraSpecialArgs = { inherit inputs ; hostName = "StuPC";};
|
||||
extraSpecialArgs = { inherit inputs outputs; hostName = "StuPC";};
|
||||
modules = [
|
||||
# > Our main home-manager configuration file <
|
||||
./home-manager/users/sstent
|
||||
|
||||
Reference in New Issue
Block a user