From b551adfdee1ce9deb6ffe0bbb67416379fbcde6e Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sat, 11 Sep 2021 13:07:55 -0400 Subject: [PATCH] unfuck a few things --- flake.nix | 34 ++++++++++++++++------------------ home.nix | 12 ++++-------- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/flake.nix b/flake.nix index 6f860b6..a0e7826 100644 --- a/flake.nix +++ b/flake.nix @@ -21,21 +21,8 @@ outputs = inputs@{ self, home-manager, nixpkgs, ... }: let system = "x86_64-linux"; - # Features common to all of my machines - commonModules = [ - ./features/self-ide.nix - ./features/caches - ./features/current-location.nix - ./features/passwordstore.nix - ./features/syncthing.nix - ./features/protonvpn.nix - ./features/server/harden.nix - ]; - graphicsCommonModules = [ - ./features/monitor-brightness.nix - ]; # Make configuration for any computer I use in my home office. - mkHomeMachine = configurationNix: extraModules: nixpkgs.lib.nixosSystem { + mkHomeMachine = bare: configurationNix: extraModules: nixpkgs.lib.nixosSystem { inherit system; # Arguments to pass to all modules. specialArgs = { inherit system inputs; }; @@ -44,17 +31,26 @@ # System configuration configurationNix + # common + ./features/self-ide.nix + ./features/caches + ./features/current-location.nix + ./features/passwordstore.nix + ./features/syncthing.nix + ./features/protonvpn.nix + ./features/server/harden.nix + # home-manager configuration home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.srid = import ./home.nix { - inherit inputs system; + inherit inputs system bare; pkgs = import nixpkgs { inherit system; }; }; } - ] ++ commonModules ++ extraModules + ] ++ extraModules ); }; in @@ -62,8 +58,9 @@ # The "name" in nixosConfigurations.${name} should match the `hostname` # nixosConfigurations.p71 = mkHomeMachine + false ./hosts/p71.nix - (graphicsCommonModules ++ [ + [ inputs.nixos-hardware.nixosModules.lenovo-thinkpad-p53 ./features/desktopish #./features/gnome.nix @@ -75,7 +72,7 @@ #./features/server-mode.nix # ./features/postgrest.nix ./features/server/devserver.nix - ]); + ]; nixosConfigurations.x1c7 = mkHomeMachine ./hosts/x1c7.nix [ @@ -85,6 +82,7 @@ ./features/desktopish/guiapps.nix ]; nixosConfigurations.facade = mkHomeMachine + true ./hosts/facade.nix [ ]; diff --git a/home.nix b/home.nix index 9011353..c57782b 100644 --- a/home.nix +++ b/home.nix @@ -1,4 +1,4 @@ -{ pkgs, inputs, system, ... }: +{ bare ? false, pkgs, inputs, system, ... }: let nix-thunk = (import (builtins.fetchTarball "https://github.com/obsidiansystems/nix-thunk/archive/master.tar.gz") { }).command; @@ -15,11 +15,10 @@ rec { home.username = "srid"; home.homeDirectory = "/home/srid"; - imports = [ - inputs.nix-doom-emacs.hmModule - ]; + imports = pkgs.lib.optional (!bare) + inputs.nix-doom-emacs.hmModule; - home.packages = with pkgs; [ + home.packages = with pkgs; lib.optionals (!bare) [ gnumake cachix tig @@ -158,9 +157,6 @@ rec { "p71" = { hostname = "192.168.2.76"; }; - "ryzen9" = { - hostname = "162.55.241.231"; - }; }; };