+/config

my dotfiles and nix configuration

git clone https://git.julia.blue/+/config

Julia RyanEnable motd25665e9

main
4.8 KiB125 linesraw
1{
2  description = "nix configs for my computers";
3  inputs = {
4    nixpkgs.url            = "github:NixOS/nixpkgs/nixos-unstable";
5    nixpkgs-stable.url     = "github:NixOS/nixpkgs/nixos-25.11";
6    home-manager.url       = "github:nix-community/home-manager";
7    flake-utils.url        = "github:numtide/flake-utils";
8    nixos-hardware.url     = "github:NixOS/nixos-hardware";
9    ragenix.url            = "github:yaxitech/ragenix";
10    nix-index-database.url = "github:Mic92/nix-index-database";
11
12    sorcery.url            = "git+https://git.t4t.associates/char/sorcery?rev=ed73aac3ef3785ec9a265dff7fbd62ddf9616e82&shallow=1";
13    catppuccin.url         = "github:catppuccin/nix";
14    slippi.url             = "github:p1n3appl3/slippi-nix/remove-trace";
15    tgm.url                = "github:p1n3appl3/mame-tgm";
16    # TODO: swap back from fork once lazymc is merged
17    nix-minecraft.url      = "github:p1n3appl3/nix-minecraft/lazymc";
18    obs-gamepad.url        = "git+http://git.julia.blue/+/obs-gamepad?shallow=1";
19  };
20
21  outputs = { nixpkgs, nixpkgs-stable, home-manager, flake-utils, ragenix,
22  self, obs-gamepad, nix-minecraft, tgm, ... } @ inputs:
23  let
24    inherit (nixpkgs) lib;
25    mapDir = lib.filesystem.packagesFromDirectoryRecursive;
26    system = "x86_64-linux";
27    special = {
28      pkgs-stable = import nixpkgs-stable { inherit system;  config.allowUnfree = true; };
29      inherit inputs self;
30    };
31
32    home = module: home-manager.lib.homeManagerConfiguration {
33      pkgs = nixpkgs.legacyPackages.${system};
34      extraSpecialArgs = special;
35      modules = [ ./mixins/home/common.nix module ] ++
36        builtins.attrValues self.outputs.homeModules;
37    };
38
39    machine = module: lib.nixosSystem {
40        inherit system; specialArgs = special;
41        modules = [
42          ./mixins/nixos/common.nix module
43          { home-manager.extraSpecialArgs = special; }
44        ] ++ builtins.attrValues self.outputs.nixosModules;
45      };
46  in {
47    homeConfigurations = {
48      ATLAS = home ./machines/atlas.nix;
49      guest = home ./machines/guest.nix;
50    };
51
52    nixosConfigurations = {
53      Cortana = machine ./machines/cortana/main.nix;
54      WOPR    = machine ./machines/wopr/main.nix;
55      HAL     = machine ./machines/hal/main.nix;
56      ISO     = machine ./machines/iso.nix;
57    };
58
59    # homeModules  = mapDir { directory = ./modules/home; callPackage = import; };
60    # nixosModules = mapDir { directory = ./modules/nixos; callPackage = import; };
61    homeModules = {
62      awawausb = import ./modules/home/awawausb.nix;
63      fightcade = import ./modules/home/fightcade.nix;
64    };
65    nixosModules = {
66      m-overlay = import ./modules/nixos/m-overlay.nix;
67      porkbun-ddns = import ./modules/nixos/porkbun-ddns.nix;
68      rust-rpxy = import ./modules/nixos/rust-rpxy.nix;
69      sorcery = import ./modules/nixos/sorcery.nix;
70    };
71
72    overlays.default = let myPackages = final: _: mapDir {
73      directory = ./pkgs; inherit (final) callPackage;
74    }; in lib.composeManyExtensions [
75      ragenix.overlays.default nix-minecraft.overlay obs-gamepad.overlays.default
76      (import ./overlays.nix) myPackages
77    ];
78
79  } // (flake-utils.lib.eachSystem (with flake-utils.lib.system; [ x86_64-linux aarch64-linux ])
80    (system: let
81      pkgs = import nixpkgs { inherit system; 
82        overlays = [ self.overlays.default ];
83        config.allowUnfree = true;
84      };
85    in with lib; rec {
86      packages = (pipe ./pkgs [
87        (dir: mapDir { directory = dir; inherit (pkgs) callPackage; })
88        (filterAttrs (_: meta.availableOn pkgs.stdenv.hostPlatform))
89        (filterAttrs (_: p: !(p.meta.broken or false)))
90      ]) // { inherit (pkgs) eza gdu ragenix chhoto-url; }; # just for caching
91
92      ci = (pipe self.nixosConfigurations [
93        (lib.filterAttrs (_: v: v.config.nixpkgs.system == system))
94        (lib.mapAttrs (_: v: v.config.system.build.toplevel))
95      ]) // packages;
96    })
97  );
98
99  nixConfig = {
100    extra-substituters = [ "https://pineapple.cachix.org" ];
101    extra-trusted-public-keys = [
102      "pineapple.cachix.org-1:FjFjdb26PFCZL09M2yHiPw1J+c1Ab9AbpfnFeTpzNQk="
103    ];
104  };
105
106  # let me put this in the lock file or smth >:(
107  inputs = {
108    home-manager.inputs.nixpkgs.follows = "nixpkgs";
109    nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
110    nixos-hardware.inputs.nixpkgs.follows = "nixpkgs";
111    ragenix.inputs = {
112      nixpkgs.follows = "nixpkgs-stable"; flake-utils.follows = "flake-utils";
113      agenix.inputs.home-manager.follows = "home-manager";
114    };
115    slippi.inputs = {
116      nixpkgs.follows = "nixpkgs"; home-manager.follows = "home-manager";
117      git-hooks.follows = "";
118    };
119    tgm.inputs.nixpkgs.follows = "nixpkgs-stable";
120    sorcery.inputs.nixpkgs.follows = "nixpkgs";
121    nix-minecraft.inputs.nixpkgs.follows = "nixpkgs";
122    catppuccin.inputs.nixpkgs.follows = "nixpkgs";
123    obs-gamepad.inputs.nixpkgs.follows = "nixpkgs";
124  };
125}