Initial commit
This commit is contained in:
commit
ea1a31f442
37 changed files with 875 additions and 0 deletions
51
roles/common/configuration.nix
Executable file
51
roles/common/configuration.nix
Executable file
|
|
@ -0,0 +1,51 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment = {
|
||||
# As of the 1st of May 2023, the default packages are nano, perl, rsync and strace
|
||||
# I don't need any of them, so I just empty the list
|
||||
defaultPackages = [];
|
||||
variables = {
|
||||
# Environment variables go here
|
||||
EDITOR = "micro";
|
||||
};
|
||||
};
|
||||
|
||||
# Set up secrets
|
||||
age = {
|
||||
identityPaths = [
|
||||
"/etc/ssh/ssh_host_rsa_key"
|
||||
"/etc/ssh/ssh_host_ed25519_key"
|
||||
# This key has a passcode, so if you need to use it you'll have to
|
||||
# enter the password A LOT of times. Only on the first setup tho
|
||||
"/tmp/id_ed25519_bootstrap"
|
||||
];
|
||||
# Copy (NOT SYMLINK) host ssh keys into place
|
||||
secrets = {
|
||||
"ed25519" = {
|
||||
symlink = false;
|
||||
file = ../../secrets/Everest/host-key-ed25519;
|
||||
path = "/etc/ssh/ssh_host_ed25519_key";
|
||||
};
|
||||
"rsa" = {
|
||||
symlink = false;
|
||||
file = ../../secrets/Everest/host-key-rsa;
|
||||
path= "/etc/ssh/ssh_host_rsa_key";
|
||||
};
|
||||
"ed25519-public" = {
|
||||
symlink = false;
|
||||
file = ../../secrets/Everest/host-key-ed25519-public;
|
||||
path = "/etc/ssh/ssh_host_ed25519_key.pub";
|
||||
mode = "0644";
|
||||
};
|
||||
"rsa-public" = {
|
||||
symlink = false;
|
||||
file = ../../secrets/Everest/host-key-rsa-public;
|
||||
path = "/etc/ssh/ssh_host_rsa_key.pub";
|
||||
mode = "0644";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "22.11";
|
||||
}
|
||||
9
roles/common/default.nix
Executable file
9
roles/common/default.nix
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./programs
|
||||
./services/avahi.nix
|
||||
./configuration.nix
|
||||
];
|
||||
}
|
||||
6
roles/common/programs/command-not-found.nix
Executable file
6
roles/common/programs/command-not-found.nix
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
# The nixpkgs command-not-found script does not work with flakes, so I disable it
|
||||
programs.command-not-found.enable = false;
|
||||
}
|
||||
23
roles/common/programs/default.nix
Executable file
23
roles/common/programs/default.nix
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./htop.nix
|
||||
./nix.nix
|
||||
./nix-index.nix
|
||||
./command-not-found.nix
|
||||
];
|
||||
# Some programs dont have a programs.*.enable option, so I install their package here
|
||||
environment.systemPackages = with pkgs; [
|
||||
speedtest-cli
|
||||
bat
|
||||
micro
|
||||
nvd
|
||||
ncdu
|
||||
tree
|
||||
btdu
|
||||
btop
|
||||
iperf3
|
||||
restic
|
||||
];
|
||||
}
|
||||
15
roles/common/programs/htop.nix
Executable file
15
roles/common/programs/htop.nix
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
programs.htop = {
|
||||
enable = true;
|
||||
settings = {
|
||||
tree_view = 1;
|
||||
highlight_base_name = 1;
|
||||
show_program_path = 0;
|
||||
show_cpu_frequency = 1;
|
||||
show_cpu_temperature = 1;
|
||||
hide_userland_threads = 1;
|
||||
};
|
||||
};
|
||||
}
|
||||
8
roles/common/programs/nix-index.nix
Executable file
8
roles/common/programs/nix-index.nix
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = [ pkgs.nix-index ];
|
||||
programs.bash.interactiveShellInit = ''
|
||||
source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh
|
||||
'';
|
||||
}
|
||||
15
roles/common/programs/nix.nix
Executable file
15
roles/common/programs/nix.nix
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
nix = {
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
registry = {
|
||||
agenix = {
|
||||
from = { id = "agenix"; type = "indirect"; };
|
||||
to = { owner = "ryantm"; repo = "agenix"; type = "github"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
8
roles/common/services/avahi.nix
Executable file
8
roles/common/services/avahi.nix
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue