flake rework after felixalb

This commit is contained in:
Adrian Gunnar Lauterer 2024-03-31 00:44:48 +01:00
parent a976c3a1e1
commit 2d339caf57
3 changed files with 234 additions and 102 deletions

289
flake.nix
View File

@ -1,117 +1,216 @@
{ {
description = "stolen from PVV System flake, not currently implemented"; description = "My System flake";
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-23.11-small"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable-small"; unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nix-darwin.url = "github:lnl7/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
matrix-synapse-next.url = "github:dali99/nixos-matrix-modules";
nix-minecraft.url = "github:Infinidoge/nix-minecraft";
# voyager-addons.url = "git+ssh://git@git.feal.no:2222/felixalb/voyager-addons.git";
voyager-addons.url = "git+file:///home/felixalb/voyager-addons";
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs"; sops-nix.inputs.nixpkgs.follows = "nixpkgs";
matrix-next.url = "github:dali99/nixos-matrix-modules";
matrix-next.inputs.nixpkgs.follows = "nixpkgs";
grzegorz.url = "github:Programvareverkstedet/grzegorz";
grzegorz.inputs.nixpkgs.follows = "nixpkgs-unstable";
grzegorz-clients.url = "github:Programvareverkstedet/grzegorz-clients";
grzegorz-clients.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, disko, ... }@inputs: outputs = {
let self
nixlib = nixpkgs.lib; , home-manager
systems = [ , matrix-synapse-next
"x86_64-linux" , nix-minecraft
"aarch64-linux" , nixpkgs
]; , sops-nix
forAllSystems = f: nixlib.genAttrs systems (system: f system); , unstable
allMachines = nixlib.mapAttrsToList (name: _: name) self.nixosConfigurations; , ... }@inputs:
importantMachines = [ let
"aragon" overlay-unstable = final: prev: {
"galadriel" unstable = unstable.legacyPackages.${prev.system};
"elrond" };
"georg" in
]; {
in { nixosConfigurations = {
nixosConfigurations = let
nixosConfig = nixpkgs: name: config: nixpkgs.lib.nixosSystem (nixpkgs.lib.recursiveUpdate
rec { # aragon = nixpkgs.lib.nixosSystem {
# system = "x86_64-linux";
# specialArgs = {
# inherit inputs;
# };
# modules = [
# # Overlays-module makes "pkgs.unstable" available in configuration.nix
# ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
# ./machines/aragon/configuration.nix
# sops-nix.nixosModules.sops
# home-manager.nixosModules.home-manager {
# home-manager.useGlobalPkgs = true;
# home-manager.useUserPackages = true;
# home-manager.users."gunalx" = import ./home/home.nix;
# }
# ];
# };
galadriel = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { specialArgs = {
inherit nixpkgs-unstable inputs; inherit inputs;
values = import ./values.nix;
}; };
modules = [ modules = [
./hosts/${name}/configuration.nix # Overlays-module makes "pkgs.unstable" available in configuration.nix
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
./machines/galadriel/configuration.nix
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
]; ];
};
pkgs = import nixpkgs { elrond = nixpkgs.lib.nixosSystem {
inherit system; system = "x86_64-linux";
overlays = [ specialArgs = {
inputs.pvv-calendar-bot.overlays.${system}.default inherit inputs;
];
}; };
} modules = [
config ./machines/elrond/configuration.nix
); ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
sops-nix.nixosModules.sops
stableNixosConfig = nixosConfig nixpkgs; ];
unstableNixosConfig = nixosConfig nixpkgs-unstable; };
in {
bicep = stableNixosConfig "bicep" {
modules = [
./hosts/bicep/configuration.nix
sops-nix.nixosModules.sops
inputs.matrix-next.nixosModules.default
inputs.pvv-calendar-bot.nixosModules.default
];
}; };
#was bekkalokk
galadriel = stableNixosConfig "galadriel" { };
ildkule = stableNixosConfig "ildkule" { };
shark = stableNixosConfig "shark" { };
georg = stableNixosConfig "georg" {
modules = [
./hosts/georg/configuration.nix
sops-nix.nixosModules.sops
inputs.grzegorz.nixosModules.grzegorz-kiosk
inputs.grzegorz-clients.nixosModules.grzegorz-webui devShells.x86_64-linux = {
]; default = nixpkgs.legacyPackages.x86_64-linux.callPackage ./home/shell.nix { };
}; };
buskerud = stableNixosConfig "buskerud" { devShells.aarch64-linux = {
modules = [ default = nixpkgs.legacyPackages.aarch64-linux.callPackage ./home/shell.nix { };
./hosts/buskerud/configuration.nix
sops-nix.nixosModules.sops
];
}; };
}; };
#devShells = forAllSystems (system: {
# default = nixpkgs.legacyPackages.${system}.callPackage ./shell.nix { };
#});
packages = {
"x86_64-linux" = let
pkgs = nixpkgs.legacyPackages."x86_64-linux";
in rec {
default = important-machines;
important-machines = pkgs.linkFarm "important-machines"
(nixlib.getAttrs importantMachines self.packages.x86_64-linux);
all-machines = pkgs.linkFarm "all-machines"
(nixlib.getAttrs allMachines self.packages.x86_64-linux);
} // nixlib.genAttrs allMachines
(machine: self.nixosConfigurations.${machine}.config.system.build.toplevel);
};
};
} }

9
home/shell.nix Normal file
View File

@ -0,0 +1,9 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
sops
gnupg
];
}

View File

@ -18,7 +18,16 @@
../../services/stableDiffusion.nix ../../services/stableDiffusion.nix
#../../services/freshrrs.nix #../../services/freshrrs.nix
#../../services/torrent.nix #../../services/torrent.nix
];
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
networking.hostName = "galadriel"; # Define your hostname. networking.hostName = "galadriel"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
@ -91,7 +100,7 @@
# List services that you want to enable: # List services that you want to enable:
##productivity ##productivity
services.tandoor-recipes.enable = true; #services.tandoor-recipes.enable = true;
##media ##media
users.groups.media.members = ["jellyfin"]; #have media directory owned by media group users.groups.media.members = ["jellyfin"]; #have media directory owned by media group
@ -101,13 +110,13 @@
# services.komga.enable = true; # services.komga.enable = true;
services.polaris.enable = true; #services.polaris.enable = true;
services.navidrome.enable = true; #services.navidrome.enable = true;
services.podgrab.enable = true; #services.podgrab.enable = true;
services.podgrab.port = 4242; #services.podgrab.port = 4242;
services.calibre-web.enable = true; #services.calibre-web.enable = true;
#services.calibre-server.enable = true; #services.calibre-server.enable = true;
##networking ##networking
@ -156,4 +165,19 @@
# "x-systemd.idle-timeout=600" # "x-systemd.idle-timeout=600"
# ]; # ];
# }; # };
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
} }