Configuration for my NixOS based systems and Home Manager
1{
2 description = "Home Manager configuration for noah";
3
4 inputs = {
5 # Specify the source of Home Manager and Nixpkgs.
6 nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
7 nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
8 determinite = {
9 url = "https://flakehub.com/f/DeterminateSystems/determinate/3";
10 inputs.nixpkgs.follows = "nixpkgs";
11 };
12 home-manager = {
13 url = "github:nix-community/home-manager/release-25.11";
14 inputs.nixpkgs.follows = "nixpkgs";
15 };
16 pre-commit-hooks.url = "github:cachix/git-hooks.nix";
17 agenix.url = "github:ryantm/agenix";
18 };
19
20 outputs =
21 { self
22 , nixpkgs
23 , nixpkgs-unstable
24 , determinite
25 , home-manager
26 , pre-commit-hooks
27 , agenix
28 , ...
29 }@inputs:
30 let
31 system = "x86_64-linux";
32 pkgs = import nixpkgs {
33 inherit system;
34 };
35 unstable = import nixpkgs-unstable {
36 inherit system;
37 config.allowUnfreePredicate =
38 pkg:
39 builtins.elem (pkgs.lib.getName pkg) [
40 "plexmediaserver"
41 "teamspeak-server"
42 ];
43 overlays = [
44 (final: prev: {
45 # Override the version of Plex installed to be the latest
46 plexRaw = prev.plexRaw.overrideAttrs rec {
47 version = "1.43.0.10389-8be686aa6";
48 src = final.fetchurl {
49 url = "https://downloads.plex.tv/plex-media-server-new/${version}/debian/plexmediaserver_${version}_amd64.deb";
50 sha256 = "0HjB8Ggekwl5dKwM1Kh51Ic25t3V6veKbuzM7czrpeg=";
51 };
52 };
53 ## Override the json object that contains verions and hashes for Immich
54 #immich = prev.immich.override { sourcesJSON = ./overrides/immich-sources.json; };
55 ## Fix errors wit numpy version failing to resolve in the immich ML package
56 #immich-machine-learning = prev.immich-machine-learning.overrideAttrs
57 # (finalAttrs: prevAttrs: {
58 # pythonRelaxDeps = prevAttrs.pythonRelaxDeps ++ [ "numpy" ];
59 # });
60 })
61 ];
62 };
63 supportedSystems = [
64 "x86_64-linux"
65 "aarch64-linux"
66 "x86_64-darwin"
67 "aarch64-darwin"
68 ];
69 forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
70 in
71 {
72 nixosConfigurations.misaki = inputs.nixpkgs.lib.nixosSystem {
73 system = "x86_64-linux";
74 specialArgs = { inherit unstable inputs home-manager; };
75 modules = [
76 determinite.nixosModules.default
77 ./configuration.nix
78 agenix.nixosModules.default
79 home-manager.nixosModules.home-manager
80 {
81 home-manager.useGlobalPkgs = true;
82 home-manager.useUserPackages = true;
83 home-manager.users.noah = ./home.nix;
84 home-manager.extraSpecialArgs = {
85 inherit unstable;
86 };
87
88 # Optionally, use home-manager.extraSpecialArgs to pass
89 # arguments to home.nix
90 }
91 ];
92 };
93 homeConfigurations."noah" = home-manager.lib.homeManagerConfiguration {
94 inherit pkgs;
95
96 # Specify your home configuration modules here, for example,
97 # the path to your home.nix.
98 modules = [ ./noah-home.nix ];
99
100 # Optionally use extraSpecialArgs
101 # to pass through arguments to home.nix
102 extraSpecialArgs = {
103 inherit unstable;
104 };
105 };
106 checks = forAllSystems (system: {
107 pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
108 src = ./.;
109 # If your hooks are intrusive, avoid running on each commit with a default_states like this:
110 # default_stages = ["manual" "push"];
111 hooks = {
112 nixpkgs-fmt.enable = true;
113 nil.enable = true;
114 luacheck.enable = true;
115 };
116 };
117 });
118 devShells = forAllSystems (system: {
119 default = nixpkgs.legacyPackages.${system}.mkShell {
120 inherit (self.checks.${system}.pre-commit-check) shellHook;
121 buildInputs = [
122 pkgs.nixfmt-rfc-style
123 ]
124 ++ self.checks.${system}.pre-commit-check.enabledPackages;
125 };
126 });
127 formatter.${system} = inputs.nixpkgs.legacyPackages.${system}.nixfmt-rfc-style;
128 };
129}