Nix configurations for my personal machines (Linux & macOS)
1{
2 inputs = {
3 nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
4 nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
5 # nur.url = "github:nix-community/NUR";
6
7 nix-darwin = {
8 url = "github:nix-darwin/nix-darwin";
9 inputs.nixpkgs.follows = "nixpkgs";
10 };
11
12 home-manager = {
13 url = "github:nix-community/home-manager";
14 inputs.nixpkgs.follows = "nixpkgs";
15 };
16
17 nix-index-database = {
18 url = "github:nix-community/nix-index-database";
19 inputs.nixpkgs.follows = "nixpkgs";
20 };
21
22 iosevka-solai = {
23 url = "github:ovyerus/iosevka-solai";
24 inputs.nixpkgs.follows = "nixpkgs";
25 };
26
27 niri-flake = {
28 url = "github:sodiboo/niri-flake";
29 inputs.nixpkgs.follows = "nixpkgs";
30 };
31
32 lix-module = {
33 url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.3-2.tar.gz";
34 inputs.nixpkgs.follows = "nixpkgs";
35 };
36
37 denix = {
38 url = "github:yunfachi/denix";
39 inputs.nixpkgs.follows = "nixpkgs";
40 inputs.nix-darwin.follows = "nix-darwin";
41 inputs.home-manager.follows = "home-manager";
42 };
43
44 zen-browser = {
45 url = "github:youwen5/zen-browser-flake";
46 inputs.nixpkgs.follows = "nixpkgs";
47 };
48 };
49
50 outputs = {
51 denix,
52 home-manager,
53 lix-module,
54 niri-flake,
55 nix-darwin,
56 nix-index-database,
57 nixpkgs,
58 self,
59 ...
60 } @ inputs: let
61 forSystems = fn:
62 nixpkgs.lib.genAttrs [
63 "aarch64-linux"
64 "aarch64-darwin"
65 "x86_64-darwin"
66 "x86_64-linux"
67 ] (system: fn nixpkgs.legacyPackages.${system});
68 defaultForSystems = fn: forSystems (pkgs: {default = fn pkgs;});
69
70 mkConfigurations = moduleSystem:
71 denix.lib.configurations (let
72 homeManagerUser = "ovy";
73 in {
74 inherit moduleSystem homeManagerUser;
75
76 paths = [./hosts ./modules]; #./rices];
77 specialArgs = {inherit inputs moduleSystem homeManagerUser;};
78 });
79 in {
80 packages = forSystems (pkgs: {
81 iconifydl = pkgs.callPackage ./pkgs/iconifydl.nix {};
82 });
83
84 devShells = defaultForSystems (pkgs:
85 pkgs.mkShell {
86 buildInputs = [pkgs.just];
87 });
88
89 nixosConfigurations = mkConfigurations "nixos";
90 darwinConfigurations = mkConfigurations "darwin";
91
92 # nixosModules.serverHomeManager = {...}: {
93 # imports = [home-manager.nixosModules.home-manager];
94
95 # home-manager = {
96 # useGlobalPkgs = true;
97 # useUserPackages = true;
98 # backupFileExtension = "backup";
99 # users.ovy = import ./home/server.nix;
100 # extraSpecialArgs = {inherit inputs;};
101 # };
102 # };
103
104 formatter = forSystems (pkgs: pkgs.alejandra);
105 };
106}