214 lines
		
	
	
		
			6.1 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			214 lines
		
	
	
		
			6.1 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
| {
 | |
|   description = "NixOS configuration for my machines";
 | |
| 
 | |
|   nixConfig = {
 | |
|     substituters = [
 | |
|       "https://cache.nixos.org/?priority=1&want-mass-query=true"
 | |
|       "https://nix-community.cachix.org/?priority=10&want-mass-query=true"
 | |
|       "https://attic.nayeonie.com/nix-cache"
 | |
|       "https://cosmic.cachix.org/"
 | |
|     ];
 | |
|     trusted-substituters = [
 | |
|       "https://cache.nixos.org"
 | |
|       "https://nix-community.cachix.org"
 | |
|       "https://attic.nayeonie.com/nix-cache"
 | |
|       "https://cosmic.cachix.org/"
 | |
|     ];
 | |
|     trusted-public-keys = [
 | |
|       "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
 | |
|       "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
 | |
|       "nix-cache:grGRsHhqNDhkEuTODvHJXYmoCClntC+U8XAJQzwMaZM="
 | |
|       "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="
 | |
|     ];
 | |
|     trusted-users = [ "root" ];
 | |
|     allow-import-from-derivation = true;
 | |
|     fallback = true;
 | |
|   };
 | |
| 
 | |
|   inputs = {
 | |
|     # flake inputs with no explicit deps (in alphabetic order)
 | |
|     flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
 | |
|     flake-parts.url = "github:hercules-ci/flake-parts";
 | |
|     nixos-hardware.url = "github:NixOS/nixos-hardware";
 | |
|     nixpkgs.url = "github:nuschtos/nuschtpkgs/nixos-unstable";
 | |
|     #nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
 | |
|     #nixpkgs.url = "github:nixos/nixpkgs/1d2fe0135f360c970aee1d57a53f816f3c9bddae?narHash=sha256-Up7YlXIupmT7fEtC4Oj676M91INg0HAoamiswAsA3rc%3D";
 | |
|     nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11";
 | |
|     systems.url = "github:nix-systems/default";
 | |
| 
 | |
|     # flake inputs with dependencies (in alphabetic order)
 | |
|     firefox-addons = {
 | |
|       url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
 | |
|       inputs = {
 | |
|         nixpkgs.follows = "nixpkgs";
 | |
|       };
 | |
|     };
 | |
| 
 | |
|     flake-utils = {
 | |
|       url = "github:numtide/flake-utils";
 | |
|       inputs.systems.follows = "systems";
 | |
|     };
 | |
| 
 | |
|     home-manager = {
 | |
|       url = "github:nix-community/home-manager";
 | |
|       inputs.nixpkgs.follows = "nixpkgs";
 | |
|     };
 | |
| 
 | |
|     hydra = {
 | |
|       url = "git+https://nayeonie.com/ahuston-0/hydra?ref=add-gitea-pulls";
 | |
|       inputs = {
 | |
|         nixpkgs.follows = "nixpkgs";
 | |
|       };
 | |
|     };
 | |
| 
 | |
|     hyprland-contrib = {
 | |
|       url = "github:hyprwm/contrib";
 | |
|       inputs.nixpkgs.follows = "nixpkgs";
 | |
|     };
 | |
| 
 | |
|     #lix-module = {
 | |
|     #  url = "git+https://git.lix.systems/lix-project/nixos-module?ref=stable";
 | |
|     #  inputs = {
 | |
|     #    nixpkgs.follows = "nixpkgs";
 | |
|     #    flake-utils.follows = "flake-utils";
 | |
|     #  };
 | |
|     #};
 | |
| 
 | |
|     nix-index-database = {
 | |
|       url = "github:Mic92/nix-index-database";
 | |
|       inputs.nixpkgs.follows = "nixpkgs";
 | |
|     };
 | |
| 
 | |
|     nixos-cosmic = {
 | |
|       url = "github:lilyinstarlight/nixos-cosmic";
 | |
|       inputs = {
 | |
|         flake-compat.follows = "flake-compat";
 | |
|         nixpkgs.follows = "nixpkgs";
 | |
|         nixpkgs-stable.follows = "nixpkgs-stable";
 | |
|         rust-overlay.follows = "rust-overlay";
 | |
|       };
 | |
|     };
 | |
| 
 | |
|     nixos-generators = {
 | |
|       url = "github:nix-community/nixos-generators";
 | |
|       inputs.nixpkgs.follows = "nixpkgs";
 | |
|     };
 | |
| 
 | |
|     nixos-modules = {
 | |
|       url = "github:NuschtOS/nixos-modules";
 | |
|       inputs = {
 | |
|         nixpkgs.follows = "nixpkgs";
 | |
|         flake-utils.follows = "flake-utils";
 | |
|       };
 | |
|     };
 | |
| 
 | |
|     pre-commit-hooks = {
 | |
|       url = "github:cachix/git-hooks.nix";
 | |
|       inputs = {
 | |
|         nixpkgs.follows = "nixpkgs";
 | |
|         flake-compat.follows = "flake-compat";
 | |
|       };
 | |
|     };
 | |
| 
 | |
|     rust-overlay = {
 | |
|       url = "github:oxalica/rust-overlay";
 | |
|       inputs = {
 | |
|         nixpkgs.follows = "nixpkgs";
 | |
|       };
 | |
|     };
 | |
| 
 | |
|     sops-nix = {
 | |
|       url = "github:Mic92/sops-nix";
 | |
|       inputs = {
 | |
|         nixpkgs.follows = "nixpkgs";
 | |
|       };
 | |
|     };
 | |
| 
 | |
|     stylix = {
 | |
|       url = "github:danth/stylix";
 | |
|       inputs = {
 | |
|         nixpkgs.follows = "nixpkgs";
 | |
|       };
 | |
|     };
 | |
| 
 | |
|     wired-notify = {
 | |
|       url = "github:Toqozz/wired-notify";
 | |
|       inputs = {
 | |
|         nixpkgs.follows = "nixpkgs";
 | |
|         rust-overlay.follows = "rust-overlay";
 | |
|         flake-parts.follows = "flake-parts";
 | |
|       };
 | |
|     };
 | |
|   };
 | |
| 
 | |
|   outputs =
 | |
|     { self, nixpkgs, ... }@inputs:
 | |
|     let
 | |
|       systems = [
 | |
|         "x86_64-linux"
 | |
|         # disable arm for now as hydra isn't set up for it
 | |
|         # "aarch64-linuxa
 | |
|       ];
 | |
| 
 | |
|       forEachSystem = lib.genAttrs systems;
 | |
| 
 | |
|       # gets the base path of the repo
 | |
|       src = builtins.path { path = ./.; };
 | |
| 
 | |
|       # adds our lib functions to lib namespace
 | |
|       lib = nixpkgs.lib.extend (
 | |
|         self: _:
 | |
|         import ./lib {
 | |
|           inherit nixpkgs inputs;
 | |
|           lib = self;
 | |
|         }
 | |
|       );
 | |
|       inherit (lib.adev.systems) genSystems getImages;
 | |
|       inherit (self) outputs; # for hydra
 | |
|     in
 | |
|     rec {
 | |
|       inherit lib; # for allowing use of custom functions in nix repl
 | |
| 
 | |
|       hydraJobs = import ./hydra/jobs.nix { inherit inputs outputs systems; };
 | |
|       formatter = forEachSystem (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
 | |
| 
 | |
|       nixosConfigurations = genSystems inputs outputs src (src + "/systems");
 | |
|       homeConfigurations = {
 | |
|         "alice" = inputs.home-manager.lib.homeManagerConfiguration {
 | |
|           pkgs = import nixpkgs { system = "x86_64-linux"; };
 | |
|           modules = [
 | |
|             inputs.stylix.homeModules.stylix
 | |
|             inputs.sops-nix.homeManagerModules.sops
 | |
|             inputs.nix-index-database.homeModules.nix-index
 | |
|             {
 | |
|               nixpkgs.config = {
 | |
|                 allowUnfree = true;
 | |
|                 allowUnfreePredicate = _: true;
 | |
|               };
 | |
|             }
 | |
|             ./users/alice/home.nix
 | |
|           ];
 | |
|           extraSpecialArgs = {
 | |
|             inherit inputs outputs;
 | |
|             machineConfig = {
 | |
|               server = false;
 | |
|             };
 | |
|           };
 | |
|         };
 | |
|       };
 | |
|       images = {
 | |
|         install-iso = getImages nixosConfigurations "install-iso";
 | |
|         iso = getImages nixosConfigurations "iso";
 | |
|         qcow = getImages nixosConfigurations "qcow";
 | |
|       };
 | |
| 
 | |
|       packages.x86_64-linux.lego-latest =
 | |
|         nixpkgs.legacyPackages.x86_64-linux.callPackage ./pkgs/lego-latest/default.nix
 | |
|           { };
 | |
| 
 | |
|       checks = import ./checks.nix { inherit inputs forEachSystem formatter; };
 | |
|       devShells = import ./shell.nix { inherit inputs forEachSystem checks; };
 | |
| 
 | |
|     };
 | |
| }
 |