blob: a87d0496b150ad1cfa11374df56d95051223dd68 [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 Greyf0b68e42022-07-17 10:18:58 +01007 nixpkgs-mongodb-fix.url = "github:Et7f3/nixpkgs/fix-mongodb";
Skyler Greya239bbe2022-05-30 23:08:02 +01008 home-manager.url = "github:nix-community/home-manager/release-22.05";
Skyler Greyc7213502022-05-21 21:12:24 +01009 nurpkgs.url = "github:nix-community/NUR";
10 comma.url = "github:nix-community/comma";
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000011
12 # Make sure flakes we depend on use the same version of nixpkgs as we do
13 home-manager.inputs.nixpkgs.follows = "nixpkgs";
Skyler Turner62330c12022-03-04 22:10:16 +000014 };
Skyler Turner85ddd892022-03-04 10:21:38 +000015
Skyler Grey92425512022-05-24 20:30:39 +010016 outputs = extraInputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, ... }:
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000017 let
18 system = "x86_64-linux"; # TOOD: Add options for MacOS
Skyler Turner85ddd892022-03-04 10:21:38 +000019
Skyler Grey30817a72022-07-21 00:36:23 +010020 unstable-overlays = import ./src/utils/nixFilesIn.nix nixpkgs-unstable.lib ./src/unstable-overlays;
21
Skyler Turnerb03a4012022-03-04 22:38:22 +000022 pkgs = import nixpkgs {
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000023 inherit system;
24
25 config = { allowUnfree = true; };
26 };
27
Skyler Grey4e7e66e2022-05-24 20:29:52 +010028 pkgs-unstable = import nixpkgs-unstable {
29 inherit system;
30
Skyler Grey30817a72022-07-21 00:36:23 +010031 overlays = map (f: import f) unstable-overlays;
Skyler Grey4e7e66e2022-05-24 20:29:52 +010032 config = { allowUnfree = true; };
33 };
34
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000035 variables = import ./src/common/variables.nix;
36 in {
Skyler Grey677635f2022-05-18 21:58:58 +010037 nixosConfigurations = {
Skyler Grey16d536e2022-05-18 22:00:59 +010038 default = nixpkgs.lib.nixosSystem {
Skyler Grey395d6282022-05-19 06:56:49 +010039 inherit system;
40
Skyler Greye11b9a72022-05-31 14:29:27 +010041 specialArgs = extraInputs // {
Skyler Grey6b155862022-07-21 00:22:20 +010042 inherit nixpkgs nixpkgs-unstable home-manager pkgs-unstable system;
Skyler Greyf93dd5a2022-05-19 06:56:58 +010043 };
Skyler Turner85ddd892022-03-04 10:21:38 +000044
Skyler Grey677635f2022-05-18 21:58:58 +010045 modules = [
46 src/system.nix
47 ];
48 };
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000049 };
Skyler Turner62330c12022-03-04 22:10:16 +000050
Skyler Grey1ec54612022-05-22 07:14:17 +010051 homeConfigurations = {
Skyler Greyb05fb742022-05-22 07:15:17 +010052 "${variables.username}" = home-manager.lib.homeManagerConfiguration rec {
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000053 inherit system pkgs;
Skyler Turner62330c12022-03-04 22:10:16 +000054
Skyler Grey6b155862022-07-21 00:22:20 +010055 extraSpecialArgs = extraInputs // { inherit nixpkgs nixpkgs-unstable home-manager pkgs-unstable system; };
Skyler Greyc7213502022-05-21 21:12:24 +010056
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000057 username = variables.username;
58 homeDirectory = "/home/${username}";
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000059 stateVersion = variables.stateVersion;
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000060
61 configuration = {
62 imports = [
63 src/home.nix
Skyler Turner62330c12022-03-04 22:10:16 +000064 ];
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000065
66 programs.home-manager.enable = true;
67 # Although I don't do any other configuration here directly,
68 # this is needed to make home-manager work and so *must* be
69 # present on every home manager configuration.
Skyler Turner20445bd2022-03-04 22:22:57 +000070 };
Skyler Turner62330c12022-03-04 22:10:16 +000071 };
Skyler Turner62330c12022-03-04 22:10:16 +000072 };
73 };
Skyler Turner85ddd892022-03-04 10:21:38 +000074}