Parameterize username
This commit is contained in:
parent
d56556b26f
commit
4bc88b4548
2
Makefile
2
Makefile
|
@ -53,7 +53,7 @@ channels:
|
||||||
|
|
||||||
$(NIXOS_PREFIX)/configuration.nix:
|
$(NIXOS_PREFIX)/configuration.nix:
|
||||||
@sudo nixos-generate-config --root "$(PREFIX)"
|
@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
|
# Convenience aliases
|
||||||
|
|
|
@ -50,7 +50,7 @@ nix-channel --add "https://nixos.org/channels/nixpkgs-unstable" nixpkgs-unstable
|
||||||
|
|
||||||
# make /etc/nixos/configuration.nix
|
# make /etc/nixos/configuration.nix
|
||||||
nixos-generate-config --root /mnt
|
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
|
# make install
|
||||||
nixos-install --root /mnt -I "my=/etc/dotfiles"
|
nixos-install --root /mnt -I "my=/etc/dotfiles"
|
||||||
|
|
11
default.nix
11
default.nix
|
@ -1,6 +1,6 @@
|
||||||
# default.nix --- my dotfile bootstrapper
|
# default.nix --- my dotfile bootstrapper
|
||||||
|
|
||||||
device:
|
device: username:
|
||||||
{ pkgs, options, lib, config, ... }:
|
{ pkgs, options, lib, config, ... }:
|
||||||
{
|
{
|
||||||
networking.hostName = lib.mkDefault device;
|
networking.hostName = lib.mkDefault device;
|
||||||
|
@ -33,6 +33,15 @@ device:
|
||||||
dots = "make -C ~/.dotfiles";
|
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
|
# This value determines the NixOS release with which your system is to be
|
||||||
# compatible, in order to avoid breaking some software such as database
|
# compatible, in order to avoid breaking some software such as database
|
||||||
# servers. You should change this only after NixOS release notes say you
|
# servers. You should change this only after NixOS release notes say you
|
||||||
|
|
|
@ -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;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -33,7 +33,6 @@
|
||||||
with pkgs; [ inetutils mtr sysstat git ];
|
with pkgs; [ inetutils mtr sysstat git ];
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./common.nix
|
|
||||||
<modules/editors/vim.nix>
|
<modules/editors/vim.nix>
|
||||||
<modules/shell/git.nix>
|
<modules/shell/git.nix>
|
||||||
<modules/shell/zsh.nix>
|
<modules/shell/zsh.nix>
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
{
|
{
|
||||||
imports = [ ./common.nix ];
|
|
||||||
|
|
||||||
# Support for more filesystems
|
# Support for more filesystems
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
exfat
|
exfat
|
||||||
|
|
Loading…
Reference in a new issue