blob: 5836101c38eb89848a6ed557baaf06e95fa32057 [file] [log] [blame]
Skyler Turner85ddd892022-03-04 10:21:38 +00001{
Skyler Turner62330c12022-03-04 22:10:16 +00002 description = "Minion3665's NixFiles (since 2022-03-24)";
Skyler Turner85ddd892022-03-04 10:21:38 +00003
Skyler Turner62330c12022-03-04 22:10:16 +00004 inputs = {
Skyler Greya239bbe2022-05-30 23:08:02 +01005 nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";
Skyler Greyf8cca8f2022-05-24 20:17:21 +01006 nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
Skyler Greya239bbe2022-05-30 23:08:02 +01007 home-manager.url = "github:nix-community/home-manager/release-22.05";
Skyler Greyc7213502022-05-21 21:12:24 +01008 nurpkgs.url = "github:nix-community/NUR";
9 comma.url = "github:nix-community/comma";
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000010
11 # Make sure flakes we depend on use the same version of nixpkgs as we do
12 home-manager.inputs.nixpkgs.follows = "nixpkgs";
Skyler Turner62330c12022-03-04 22:10:16 +000013 };
Skyler Turner85ddd892022-03-04 10:21:38 +000014
Skyler Grey92425512022-05-24 20:30:39 +010015 outputs = extraInputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, ... }:
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000016 let
17 system = "x86_64-linux"; # TOOD: Add options for MacOS
Skyler Turner85ddd892022-03-04 10:21:38 +000018
Skyler Grey30817a72022-07-21 00:36:23 +010019 unstable-overlays = import ./src/utils/nixFilesIn.nix nixpkgs-unstable.lib ./src/unstable-overlays;
20
Skyler Turnerb03a4012022-03-04 22:38:22 +000021 pkgs = import nixpkgs {
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000022 inherit system;
23
24 config = { allowUnfree = true; };
25 };
26
Skyler Grey4e7e66e2022-05-24 20:29:52 +010027 pkgs-unstable = import nixpkgs-unstable {
28 inherit system;
29
Skyler Grey30817a72022-07-21 00:36:23 +010030 overlays = map (f: import f) unstable-overlays;
Skyler Grey4e7e66e2022-05-24 20:29:52 +010031 config = { allowUnfree = true; };
32 };
33
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000034 variables = import ./src/common/variables.nix;
35 in {
Skyler Grey677635f2022-05-18 21:58:58 +010036 nixosConfigurations = {
Skyler Grey16d536e2022-05-18 22:00:59 +010037 default = nixpkgs.lib.nixosSystem {
Skyler Grey395d6282022-05-19 06:56:49 +010038 inherit system;
39
Skyler Greye11b9a72022-05-31 14:29:27 +010040 specialArgs = extraInputs // {
Skyler Grey6b155862022-07-21 00:22:20 +010041 inherit nixpkgs nixpkgs-unstable home-manager pkgs-unstable system;
Skyler Greyf93dd5a2022-05-19 06:56:58 +010042 };
Skyler Turner85ddd892022-03-04 10:21:38 +000043
Skyler Grey677635f2022-05-18 21:58:58 +010044 modules = [
45 src/system.nix
46 ];
47 };
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000048 };
Skyler Turner62330c12022-03-04 22:10:16 +000049
Skyler Grey1ec54612022-05-22 07:14:17 +010050 homeConfigurations = {
Skyler Greyb05fb742022-05-22 07:15:17 +010051 "${variables.username}" = home-manager.lib.homeManagerConfiguration rec {
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000052 inherit system pkgs;
Skyler Turner62330c12022-03-04 22:10:16 +000053
Skyler Grey6b155862022-07-21 00:22:20 +010054 extraSpecialArgs = extraInputs // { inherit nixpkgs nixpkgs-unstable home-manager pkgs-unstable system; };
Skyler Greyc7213502022-05-21 21:12:24 +010055
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000056 username = variables.username;
57 homeDirectory = "/home/${username}";
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000058 stateVersion = variables.stateVersion;
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000059
60 configuration = {
61 imports = [
62 src/home.nix
Skyler Turner62330c12022-03-04 22:10:16 +000063 ];
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000064
65 programs.home-manager.enable = true;
66 # Although I don't do any other configuration here directly,
67 # this is needed to make home-manager work and so *must* be
68 # present on every home manager configuration.
Skyler Turner20445bd2022-03-04 22:22:57 +000069 };
Skyler Turner62330c12022-03-04 22:10:16 +000070 };
Skyler Turner62330c12022-03-04 22:10:16 +000071 };
72 };
Skyler Turner85ddd892022-03-04 10:21:38 +000073}