diff --git a/Makefile b/Makefile index 26f32799..c5db1aed 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ channels: $(NIXOS_PREFIX)/configuration.nix: @sudo nixos-generate-config --root "$(PREFIX)" - @echo "import /etc/dotfiles \"$$(hostname)\"" | sudo tee "$(NIXOS_PREFIX)/configuration.nix" + @echo "import /etc/dotfiles \"$${HOST:-$$(hostname)}\" \"$$USER\"" | sudo tee "$(NIXOS_PREFIX)/configuration.nix" # Convenience aliases diff --git a/README.md b/README.md index 603a41bd..1edf0323 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ nix-channel --add "https://nixos.org/channels/nixpkgs-unstable" nixpkgs-unstable # make /etc/nixos/configuration.nix nixos-generate-config --root /mnt -echo "import /etc/dotfiles \"$$(hostname)\"" >/mnt/etc/nixos/configuration.nix +echo "import /etc/dotfiles \"$$HOST\" \"$$USER\"" >/mnt/etc/nixos/configuration.nix # make install nixos-install --root /mnt -I "my=/etc/dotfiles" diff --git a/default.nix b/default.nix index 3606c96a..2b53247f 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,6 @@ # default.nix --- my dotfile bootstrapper -device: +device: username: { pkgs, options, lib, config, ... }: { networking.hostName = lib.mkDefault device; @@ -33,6 +33,15 @@ device: dots = "make -C ~/.dotfiles"; }; + ### Primary user account + my.username = username; + my.user = { + isNormalUser = true; + uid = 1000; + extraGroups = [ "wheel" "video" "networkmanager" ]; + shell = pkgs.zsh; + }; + # This value determines the NixOS release with which your system is to be # compatible, in order to avoid breaking some software such as database # servers. You should change this only after NixOS release notes say you diff --git a/hosts/common.nix b/hosts/common.nix deleted file mode 100644 index bb8c1983..00000000 --- a/hosts/common.nix +++ /dev/null @@ -1,24 +0,0 @@ -# hosts/common.nix --- settings common to all my systems - -{ pkgs, ... }: -{ - # Just the bear necessities~ - environment.systemPackages = with pkgs; [ - coreutils - git - killall - unzip - vim - wget - sshfs - ]; - - ### My user settings - my.username = "hlissner"; - my.user = { - isNormalUser = true; - uid = 1000; - extraGroups = [ "wheel" "video" "networkmanager" ]; - shell = pkgs.zsh; - }; -} diff --git a/hosts/linode.nix b/hosts/linode.nix index ba8452f8..cd7c8f7c 100644 --- a/hosts/linode.nix +++ b/hosts/linode.nix @@ -33,7 +33,6 @@ with pkgs; [ inetutils mtr sysstat git ]; imports = [ - ./common.nix diff --git a/hosts/personal.nix b/hosts/personal.nix index 7475080f..3c539f68 100644 --- a/hosts/personal.nix +++ b/hosts/personal.nix @@ -2,8 +2,6 @@ { config, lib, pkgs, ... }: { - imports = [ ./common.nix ]; - # Support for more filesystems environment.systemPackages = with pkgs; [ exfat