flake.nix: add agenix

This commit is contained in:
Sakooooo 2024-10-02 11:33:29 +04:00
parent da6c28e055
commit fd505af57e
Signed by: sako
GPG key ID: 3FD715D87D7725E0

134
flake.nix
View file

@ -3,8 +3,10 @@
description = "Sako's NixOS Configuration"; description = "Sako's NixOS Configuration";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # nixpkgs unstable branch nixpkgs.url =
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05"; # nixpkgs stable branch because some things break "github:NixOS/nixpkgs/nixos-unstable"; # nixpkgs unstable branch
nixpkgs-stable.url =
"github:nixos/nixpkgs/nixos-24.05"; # nixpkgs stable branch because some things break
home-manager = { home-manager = {
# this manages your dotfiles for the most part # this manages your dotfiles for the most part
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
@ -20,8 +22,10 @@
url = "github:Mic92/sops-nix"; url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
agenix.url = "github:ryantm/agenix";
emacs-overlay = { emacs-overlay = {
url = "github:nix-community/emacs-overlay/0442d57ffa83985ec2ffaec95db9c0fe742f5182"; url =
"github:nix-community/emacs-overlay/0442d57ffa83985ec2ffaec95db9c0fe742f5182";
}; };
ags = { ags = {
url = "github:Aylur/ags"; url = "github:Aylur/ags";
@ -31,79 +35,63 @@
hyprpaper.url = "github:hyprwm/hyprpaper"; hyprpaper.url = "github:hyprwm/hyprpaper";
}; };
outputs = { outputs = { self, nixpkgs, home-manager, NixOS-WSL, sops-nix, agenix
self, , emacs-overlay, hyprland, hyprpaper, ags, ... }@inputs:
nixpkgs, let
home-manager, inherit (self) outputs;
NixOS-WSL, forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" ];
sops-nix, in rec {
emacs-overlay, # custom packages
hyprland, packages = forAllSystems (system:
hyprpaper, let pkgs = nixpkgs.legacyPackages.${system};
ags, in import ./packages { inherit pkgs; });
... # dev shell for bootstrap
} @ inputs: let devShells = forAllSystems (system:
inherit (self) outputs; let pkgs = nixpkgs.legacyPackages.${system};
forAllSystems = nixpkgs.lib.genAttrs [ in import ./shell.nix { inherit pkgs; });
"x86_64-linux"
];
in rec {
# custom packages
packages = forAllSystems (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in
import ./packages {inherit pkgs;}
);
# dev shell for bootstrap
devShells = forAllSystems (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in
import ./shell.nix {inherit pkgs;}
);
# overlays here # overlays here
overlays = import ./overlays {inherit inputs;}; overlays = import ./overlays { inherit inputs; };
# modules :D # modules :D
nixosModules = import ./modules; nixosModules = import ./modules;
nixosConfigurations = { nixosConfigurations = {
sakotop = nixpkgs.lib.nixosSystem { sakotop = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;}; specialArgs = { inherit inputs outputs; };
modules = [ modules = [
./default.nix ./default.nix
./hosts/sakotop/configuration.nix ./hosts/sakotop/configuration.nix
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
]; agenix.nixosModules.default
}; ];
sakopc = nixpkgs.lib.nixosSystem { };
specialArgs = {inherit inputs outputs;}; sakopc = nixpkgs.lib.nixosSystem {
modules = [ specialArgs = { inherit inputs outputs; };
./default.nix modules = [
./hosts/sakopc/configuration.nix ./default.nix
sops-nix.nixosModules.sops ./hosts/sakopc/configuration.nix
]; sops-nix.nixosModules.sops
}; ];
#sakoserver = nixpkgs.lib.nixosSystem { };
# specialArgs = {inherit inputs outputs;}; #sakoserver = nixpkgs.lib.nixosSystem {
# modules = [ # specialArgs = {inherit inputs outputs;};
# ./default.nix # modules = [
# ./hosts/sakoserver/configuration.nix # ./default.nix
# ]; # ./hosts/sakoserver/configuration.nix
#}; # ];
sakowsl = nixpkgs.lib.nixosSystem { #};
# because theres no hardware-configuration.nix sakowsl = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; # because theres no hardware-configuration.nix
specialArgs = {inherit inputs outputs;}; system = "x86_64-linux";
modules = [ specialArgs = { inherit inputs outputs; };
{nix.registry.nixpkgs.flake = nixpkgs;} modules = [
./hosts/sakowsl/configuration.nix { nix.registry.nixpkgs.flake = nixpkgs; }
NixOS-WSL.nixosModules.wsl ./hosts/sakowsl/configuration.nix
sops-nix.nixosModules.sops NixOS-WSL.nixosModules.wsl
]; sops-nix.nixosModules.sops
];
};
}; };
}; };
};
} }