My NixOS config Part 3: Flake-Parts Crusaders nix.ladas552.me
hjem nix nixos impermanence flake-parts nvfetcher niri noctalia
at master 120 lines 3.7 kB view raw
1{ 2 description = "Ladas552 NixOS config"; 3 4 inputs = { 5 # nixpkgs links 6 nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"; 7 8 # Home-manager 9 home-manager = { 10 url = "github:nix-community/home-manager"; 11 inputs.nixpkgs.follows = "nixpkgs"; 12 }; 13 14 # Hjem, another home-manager 15 hjem = { 16 url = "github:feel-co/hjem"; 17 inputs.nixpkgs.follows = "nixpkgs"; 18 # No useless inputs 19 inputs.nix-darwin.follows = ""; # I don't use nix-darwin machine 20 # inputs.smfh.follows = ""; 21 inputs.smfh.inputs.systems.follows = "systems"; 22 }; 23 # Modules for hjem 24 hjem-rum = { 25 url = "github:snugnug/hjem-rum"; 26 inputs.nixpkgs.follows = "nixpkgs"; 27 inputs.hjem.follows = "hjem"; 28 # No useless inputs 29 inputs.ndg.follows = ""; 30 inputs.treefmt-nix.follows = ""; 31 }; 32 33 flake-parts = { 34 url = "github:hercules-ci/flake-parts"; 35 # No useless inputs 36 inputs.nixpkgs-lib.follows = "nixpkgs"; 37 }; 38 39 # Neovim 40 nvf = { 41 url = "github:notashelf/nvf"; 42 # No useless inputs 43 # inputs.nixpkgs.follows = "nixpkgs"; 44 inputs.systems.follows = "systems"; 45 inputs.flake-parts.follows = "flake-parts"; 46 inputs.flake-compat.follows = ""; 47 inputs.ndg.follows = ""; 48 }; 49 50 # Niri 51 niri = { 52 url = "git+https://codeberg.org/BANanaD3V/niri-nix"; 53 # No useless inputs 54 inputs.git-hooks.follows = ""; 55 }; 56 57 # Tangled, git hosting 58 tangled = { 59 url = "git+https://tangled.org/@tangled.org/core"; 60 # No useless inputs 61 inputs.nixpkgs.follows = "nixpkgs"; 62 inputs.gomod2nix.inputs.flake-utils.inputs.systems.follows = "systems"; 63 inputs.flake-compat.follows = ""; 64 inputs.indigo.follows = ""; 65 inputs.htmx-src.follows = ""; 66 inputs.htmx-ws-src.follows = ""; 67 inputs.lucide-src.follows = ""; 68 inputs.inter-fonts-src.follows = ""; 69 inputs.actor-typeahead-src.follows = ""; 70 inputs.ibm-plex-mono-src.follows = ""; 71 inputs.mermaid-src.follows = ""; 72 inputs.fenix.follows = ""; 73 # inputs.sqlite-lib-src.follows = ""; 74 }; 75 76 # Boilerplate 77 systems.url = "github:nix-systems/default-linux"; 78 79 # Also check inputs in ./nvfetcher.toml for more modules I use 80 }; 81 outputs = 82 inputs: 83 let 84 # Function to stop using `import-tree` by Vic. 85 # Just to lighten the config a bit, written by @llakala https://github.com/llakala/synaptic-standard/blob/main/demo/recursivelyImport.nix 86 import-tree = import ./lib/recursivelyImport.nix { lib = inputs.nixpkgs.lib; }; 87 88 # a way to fetch nix files via nvfetcher and import them in the config 89 # basically parse the json crated by nvfetcher, and use fetchTarball 90 # nvfetcher uses fetchers from nixpkgs by default, so we can't use the generated.nix file here 91 # but can everywhere else. 92 sourcesJson = builtins.fromJSON (builtins.readFile ./_sources/generated.json); 93 94 modules = builtins.mapAttrs ( 95 name: value: 96 let 97 src = fetchTarball { 98 url = "${value.src.url}/archive/${value.src.rev}.tar.gz"; 99 sha256 = value.src.sha256; 100 }; 101 in 102 value // { inherit src; } 103 ) sourcesJson; 104 in 105 inputs.flake-parts.lib.mkFlake 106 { 107 inherit inputs; 108 specialArgs = { inherit modules; }; 109 } 110 { 111 imports = import-tree [ 112 ./modules 113 inputs.flake-parts.flakeModules.modules 114 ]; 115 flake.templates = import ./templates; 116 # aarch64 and x86_64 Linux systems 117 systems = import inputs.systems; 118 119 }; 120}