grace/dots
dotfiles/nix configs
git clone https://git.gae.moe/grace/dots
0e83893
main
1{ 2description = "my awesome and cool flake" ; 3 4inputs = { 5nixpkgs . url = "github:NixOS/nixpkgs/nixpkgs-unstable" ; 6darwin = { 7url = "github:nix-darwin/nix-darwin" ; 8inputs . nixpkgs . follows = "nixpkgs" ; 9} ; 10home-manager = { 11url = "github:nix-community/home-manager" ; 12inputs . nixpkgs . follows = "nixpkgs" ; 13} ; 14sops-nix = { 15url = "github:Mic92/sops-nix" ; 16inputs . nixpkgs . follows = "nixpkgs" ; 17} ; 18tpb = { 19url = "git+https://git.gae.moe/grace/tpb.git?ref=refs/tags/0.1.4" ; 20# flake = false; 21} ; 22sorcery . url = "git+https://git.gae.moe/forks/sorcery?ref=refs/heads/grace-patches" ; 23zen-browser = { 24url = "github:0xc000022070/zen-browser-flake" ; 25inputs . nixpkgs . follows = "nixpkgs" ; 26} ; 27} ; 28 29outputs = 30inputs @ { self , nixpkgs , ... } : 31let 32inherit ( nixpkgs ) lib ; 33hosts = import ./hosts.nix ; 34hostsOfType = type : lib . filterAttrs ( _ : host : host . type == type ) hosts ; 35systems = lib . unique ( map ( host : host . system ) ( builtins . attrValues hosts )) ; 36hostArgs = name : { 37inherit inputs ; 38host = hosts . ${ name } // { 39inherit name ; 40} ; 41} ; 42in 43{ 44darwinConfigurations = lib . mapAttrs ( 45name : _ : 46inputs . darwin . lib . darwinSystem { 47specialArgs = hostArgs name ; 48modules = [ ( ./hosts + "/ ${ name } .nix" ) ] ; 49} 50) ( hostsOfType "darwin" ) ; 51 52nixosConfigurations = lib . mapAttrs ( 53name : _ : 54lib . nixosSystem { 55specialArgs = hostArgs name ; 56modules = [ ( ./hosts + "/ ${ name } .nix" ) ] ; 57} 58) ( hostsOfType "nixos" ) ; 59 60homeConfigurations = lib . mapAttrs ( 61name : host : 62inputs . home-manager . lib . homeManagerConfiguration { 63extraSpecialArgs = hostArgs name ; 64pkgs = import nixpkgs { 65system = host . system ; 66config . allowUnfree = true ; 67} ; 68modules = [ ( ./hosts + "/ ${ name } .nix" ) ] ; 69} 70) ( hostsOfType "home" ) ; 71 72packages . x86_64-linux . portable-iso = 73( lib . nixosSystem { 74specialArgs = hostArgs "portable" ; 75modules = [ ./iso.nix ] ; 76}) . config . system . build . isoImage ; 77packages . x86_64-linux . portable-usb = self . nixosConfigurations . portable . config . system . build . usbImage ; 78 79devShells = lib . genAttrs systems ( 80system : 81let 82pkgs = import nixpkgs { inherit system ; } ; 83in 84{ 85default = pkgs . mkShellNoCC { 86packages = 87( with pkgs ; [ 88lixPackageSets . stable . lix 89nixos-rebuild-ng 90coreutils 91openssh 92git 93jujutsu 94jq 95nixfmt 96age 97fish 98gnupg 99gitleaks 100helix 101just 102sops 103ssh-to-age 104( python3 . withPackages ( p : [ p . pyyaml ])) 105]) 106++ [ inputs . home-manager . packages . ${ system } . home-manager ] 107++ lib . optionals pkgs . stdenv . hostPlatform . isDarwin [ 108inputs . darwin . packages . ${ system } . darwin-rebuild 109] ; 110 111EDITOR = "hx" ; 112 113shellHook = '' 114if [[ $- == *i*]] ; then 115export SHELL=${ pkgs . fish } /bin/fish 116exec " $SHELL " 117fi 118'' ; 119} ; 120} 121) ; 122} ; 123}