base: setup default config

This commit is contained in:
Antoine Martin 2021-02-14 13:18:13 +01:00
parent 72161b8c57
commit b70e37770a
3 changed files with 26 additions and 15 deletions

6
base/default.nix Normal file
View file

@ -0,0 +1,6 @@
{ ... }:
{
imports = [
./users.nix
];
}

16
base/users.nix Normal file
View file

@ -0,0 +1,16 @@
{ config, lib, pkgs, ... }:
{
users.mutableUsers = false;
users.users.root = {
hashedPassword = lib.fileContents ../secrets/shadow-hashed-password-root;
};
users.users.alarsyo = {
hashedPassword = lib.fileContents ../secrets/shadow-hashed-password-alarsyo;
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
shell = pkgs.fish;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH3rrF3VSWI4n4cpguvlmLAaU3uftuX4AVV/39S/8GO9 alarsyo@thinkpad"
];
};
}

View file

@ -8,7 +8,11 @@
imports = imports =
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./services ./services
# Default configuration
./base
]; ];
# Use the GRUB 2 boot loader. # Use the GRUB 2 boot loader.
@ -41,21 +45,6 @@
"62.210.16.7" "62.210.16.7"
]; ];
# Define a user account.
users.mutableUsers = false;
users.users.root = {
hashedPassword = lib.fileContents ./secrets/shadow-hashed-password-root;
};
users.users.alarsyo = {
hashedPassword = lib.fileContents ./secrets/shadow-hashed-password-alarsyo;
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
shell = pkgs.fish;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH3rrF3VSWI4n4cpguvlmLAaU3uftuX4AVV/39S/8GO9 alarsyo@thinkpad"
];
};
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [