server v1
This commit is contained in:
parent
96057e337b
commit
cd35565370
4 changed files with 191 additions and 7 deletions
|
|
@ -53,6 +53,15 @@
|
||||||
./hosts/tower/configuration.nix
|
./hosts/tower/configuration.nix
|
||||||
]; # end modules
|
]; # end modules
|
||||||
}; # end tower
|
}; # end tower
|
||||||
|
tesla-nixos = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [
|
||||||
|
./hosts/tesla-nixos/configuration.nix
|
||||||
|
{
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
}
|
||||||
|
]; # end modules
|
||||||
|
}; # end tesla-nixos
|
||||||
}; # end nixos conf
|
}; # end nixos conf
|
||||||
}; # end "in"
|
}; # end "in"
|
||||||
} # end file
|
} # end file
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
fish = {
|
fish = {
|
||||||
enable = true;
|
enable = false;
|
||||||
# Disable greeting
|
# Disable greeting
|
||||||
interactiveShellInit = ''
|
interactiveShellInit = ''
|
||||||
set fish_greeting
|
set fish_greeting
|
||||||
|
|
@ -45,13 +45,14 @@
|
||||||
}; # end fish
|
}; # end fish
|
||||||
nushell = {
|
nushell = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
configFile.source = ./conf/config.nu;
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
tsla-fan = "ipmitool -H 10.30.0.3 -U ADMIN -P ADMIN raw 0x30 0x70 0x66 0x01 0x0";
|
tsla-fan = "ipmitool -H 10.30.0.3 -U ADMIN -P ADMIN raw 0x30 0x70 0x66 0x01 0x0";
|
||||||
|
|
||||||
# NixOS commands
|
# NixOS commands
|
||||||
nixoss = "sudo nixos-rebuild switch --flake .#${hostName}";
|
nixoss = "sudo nixos-rebuild switch --flake .#${hostName}";
|
||||||
nixos-main = "git checkout main && git pull && sudo nixos-rebuild switch --flake #${hostName}";
|
nixos-main = "git checkout main ; git pull ; sudo nixos-rebuild switch --flake #${hostName}";
|
||||||
nixossr = "sudo nixos-rebuild switch --flake .#${hostName} && reboot";
|
nixossr = "sudo nixos-rebuild switch --flake .#${hostName} ; reboot";
|
||||||
nixost = "sudo nixos-rebuild build-vm --flake .#${hostName}";
|
nixost = "sudo nixos-rebuild build-vm --flake .#${hostName}";
|
||||||
|
|
||||||
# Development commands
|
# Development commands
|
||||||
|
|
@ -66,10 +67,7 @@
|
||||||
pypod = "podman run --rm -it --network host -v '.:/run' -w '/run' python /run/";
|
pypod = "podman run --rm -it --network host -v '.:/run' -w '/run' python /run/";
|
||||||
|
|
||||||
# Tower commands
|
# Tower commands
|
||||||
weboot = "nix shell nixpkgs#efibootmgr -c sudo efibootmgr -n 0000 && reboot";
|
weboot = "nix shell nixpkgs#efibootmgr -c sudo efibootmgr -n 0000 ; reboot";
|
||||||
|
|
||||||
# Misc commands
|
|
||||||
nix-shell = "nix shell";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
git = {
|
git = {
|
||||||
|
|
|
||||||
24
home/conf/config.nu
Normal file
24
home/conf/config.nu
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
let carapace_completer = {|spans|
|
||||||
|
carapace $spans.0 nushell ...$spans | from json
|
||||||
|
}
|
||||||
|
$env.config = {
|
||||||
|
show_banner: false,
|
||||||
|
completions: {
|
||||||
|
case_sensitive: false # case-sensitive completions
|
||||||
|
quick: true # set to false to prevent auto-selecting completions
|
||||||
|
partial: true # set to false to prevent partial filling of the prompt
|
||||||
|
algorithm: "fuzzy" # prefix or fuzzy
|
||||||
|
external: {
|
||||||
|
# set to false to prevent nushell looking into $env.PATH to find more suggestions
|
||||||
|
enable: true
|
||||||
|
# set to lower can improve completion performance at the cost of omitting some options
|
||||||
|
max_results: 100
|
||||||
|
completer: $carapace_completer # check 'carapace_completer'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$env.PATH = ($env.PATH |
|
||||||
|
split row (char esep) |
|
||||||
|
prepend /home/myuser/.apps |
|
||||||
|
append /usr/bin/env
|
||||||
|
)
|
||||||
153
hosts/tesla-nixos/configuration.nix
Normal file
153
hosts/tesla-nixos/configuration.nix
Normal file
|
|
@ -0,0 +1,153 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ ./hardware-configuration.nix ];
|
||||||
|
networking.hostName = "tesla-nixos";
|
||||||
|
boot.initrd.enable = true;
|
||||||
|
boot.loader = {
|
||||||
|
systemd-boot = {
|
||||||
|
enable = true;
|
||||||
|
}; # end loader.systemd-boot
|
||||||
|
}; # end boot
|
||||||
|
system.stateVersion = "24.05";
|
||||||
|
system.autoUpgrade = {
|
||||||
|
enable = true;
|
||||||
|
persistent = true;
|
||||||
|
flake = "/home/alisceon/.nixos_config";
|
||||||
|
flags = [
|
||||||
|
"--update-input"
|
||||||
|
"nixpkgs"
|
||||||
|
"-L"
|
||||||
|
];
|
||||||
|
dates = "daily";
|
||||||
|
}; # end system.autoUpgrade
|
||||||
|
|
||||||
|
nix = {
|
||||||
|
settings = {
|
||||||
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
auto-optimise-store = true;
|
||||||
|
trusted-users = [ "root" "alisceon" ];
|
||||||
|
}; # end settings
|
||||||
|
gc = {
|
||||||
|
automatic = true;
|
||||||
|
persistent = true;
|
||||||
|
dates = "daily";
|
||||||
|
options = "--delete-older-than 7d";
|
||||||
|
}; # end gc
|
||||||
|
registry = {
|
||||||
|
templates.to = {
|
||||||
|
type = "git";
|
||||||
|
url = "git+ssh://git@git.malice.zone/alisceon/devenv_templates.git";
|
||||||
|
}; # end templates.to
|
||||||
|
nixpkgs.to = {
|
||||||
|
type = "github";
|
||||||
|
owner = "NixOS";
|
||||||
|
repo = "nixpkgs";
|
||||||
|
ref = "nixos-unstable";
|
||||||
|
}; # end nixpkgs.to
|
||||||
|
nixpkgs-stable.to = {
|
||||||
|
type = "github";
|
||||||
|
owner = "NixOS";
|
||||||
|
repo = "nixpkgs";
|
||||||
|
ref = "nixos-25.05";
|
||||||
|
}; # end nixpkgs.to
|
||||||
|
}; #end registry
|
||||||
|
}; #end nix
|
||||||
|
|
||||||
|
console.keyMap = "sv-latin1";
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
time.timeZone = "Europe/Stockholm";
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
i18n.extraLocaleSettings = {
|
||||||
|
LC_ADDRESS = "sv_SE.UTF-8";
|
||||||
|
LC_IDENTIFICATION = "sv_SE.UTF-8";
|
||||||
|
LC_MEASUREMENT = "sv_SE.UTF-8";
|
||||||
|
LC_MONETARY = "sv_SE.UTF-8";
|
||||||
|
LC_NAME = "sv_SE.UTF-8";
|
||||||
|
LC_NUMERIC = "sv_SE.UTF-8";
|
||||||
|
LC_PAPER = "sv_SE.UTF-8";
|
||||||
|
LC_TELEPHONE = "sv_SE.UTF-8";
|
||||||
|
LC_TIME = "sv_SE.UTF-8";
|
||||||
|
};
|
||||||
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
|
||||||
|
services = {
|
||||||
|
printing.enable = true;
|
||||||
|
pulseaudio.enable = false;
|
||||||
|
pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
jack.enable = true;
|
||||||
|
};
|
||||||
|
xserver.xkb.layout = "se";
|
||||||
|
displayManager = {
|
||||||
|
gdm.enable = true;
|
||||||
|
gdm.wayland = true;
|
||||||
|
};
|
||||||
|
desktopManager.gnome.enable = true;
|
||||||
|
gnome = {
|
||||||
|
gnome-keyring.enable = true;
|
||||||
|
gnome-initial-setup.enable = false;
|
||||||
|
};
|
||||||
|
}; # end services
|
||||||
|
|
||||||
|
services.fwupd.enable = true;
|
||||||
|
programs = {
|
||||||
|
dconf.enable = true;
|
||||||
|
fish.enable = true;
|
||||||
|
steam = {
|
||||||
|
enable = true;
|
||||||
|
remotePlay.openFirewall = true;
|
||||||
|
};
|
||||||
|
}; # end programs
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
systemPackages = with pkgs; [
|
||||||
|
# CLI tools
|
||||||
|
git
|
||||||
|
wget
|
||||||
|
curl
|
||||||
|
btop # system monitor
|
||||||
|
ripgrep # grep replacement
|
||||||
|
bat # cat replacement
|
||||||
|
fd # find replacement
|
||||||
|
eza # ls replacement
|
||||||
|
nh # nix helper
|
||||||
|
jq # JSON processor
|
||||||
|
|
||||||
|
# Shells
|
||||||
|
bash
|
||||||
|
nushell
|
||||||
|
fish
|
||||||
|
powershell
|
||||||
|
|
||||||
|
devenv
|
||||||
|
direnv
|
||||||
|
|
||||||
|
# Virtualization
|
||||||
|
podman
|
||||||
|
|
||||||
|
]; # end systemPackages
|
||||||
|
|
||||||
|
shells = with pkgs; [
|
||||||
|
bash
|
||||||
|
nushell
|
||||||
|
fish
|
||||||
|
powershell
|
||||||
|
];
|
||||||
|
}; # end environment
|
||||||
|
|
||||||
|
virtualisation.podman = {
|
||||||
|
enable = true;
|
||||||
|
dockerCompat = true;
|
||||||
|
defaultNetwork.settings.dns_enabled = true;
|
||||||
|
}; # end virtualisation
|
||||||
|
|
||||||
|
users.users.alisceon = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [ "wheel" "networkmanager" "podman" ];
|
||||||
|
shell = pkgs.nushell;
|
||||||
|
}; # end users
|
||||||
|
} # end file
|
||||||
Loading…
Add table
Add a link
Reference in a new issue