Restructured alexandria
This commit is contained in:
parent
629f9196e2
commit
b3f9a791ba
8 changed files with 76 additions and 118 deletions
35
flake.nix
35
flake.nix
|
|
@ -22,9 +22,14 @@
|
|||
url = "github:nix-community/home-manager/release-22.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs-stable";
|
||||
};
|
||||
|
||||
deploy-rs = {
|
||||
url = "github:serokell/deploy-rs";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs @ { nixpkgs, home-manager, nur, kmonad, nixpkgs-stable, home-manager-stable, ... }: {
|
||||
outputs = inputs @ { nixpkgs, home-manager, nur, kmonad, nixpkgs-stable, home-manager-stable, deploy-rs, ... }: {
|
||||
nixosConfigurations = {
|
||||
io = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
|
|
@ -32,8 +37,10 @@
|
|||
modules = [
|
||||
./hosts/desktops/io.nix
|
||||
kmonad.nixosModules.default
|
||||
{ nixpkgs.overlays = [ nur.overlay ]; }
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
nixpkgs.overlays = [ nur.overlay ];
|
||||
}
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
|
|
@ -45,11 +52,31 @@
|
|||
alexandria = nixpkgs-stable.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./hosts/servers/alexandria/configuration.nix
|
||||
( {...}: { nix.registry.nixpkgs.flake = nixpkgs-stable; } )
|
||||
./hosts/servers/alexandria.nix
|
||||
home-manager-stable.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.user = import ./users/servers/user.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
deploy = {
|
||||
autoRollback = false;
|
||||
magicRollback = false;
|
||||
user = "root";
|
||||
sshUser = "root";
|
||||
nodes = {
|
||||
"alexandria" = {
|
||||
hostname = "alexandria";
|
||||
profiles.system = {
|
||||
remoteBuild = true;
|
||||
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.alexandria;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
{
|
||||
nix = {
|
||||
settings.auto-optimise-store = true;
|
||||
extraOptions = "experimental-features = nix-command flakes";
|
||||
gc = { # Garbage collector
|
||||
automatic = true;
|
||||
|
|
|
|||
34
hosts/servers/alexandria.nix
Normal file
34
hosts/servers/alexandria.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ config, pkgs, lib, ...}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# Host-specific imports
|
||||
.alexandria/hardware-configuration.nix
|
||||
.alexandria/hosted-services.nix
|
||||
# Host-common imports
|
||||
../common/networking.nix
|
||||
../common/packages.nix
|
||||
../common/services.nix
|
||||
../common/locale.nix
|
||||
../common/users.nix
|
||||
../common/boot.nix
|
||||
../common/nix.nix
|
||||
];
|
||||
|
||||
users.users.user.extraGroups = [ "docker" ];
|
||||
|
||||
swapDevices = [ { device = "/swapfile"; size = 8192; } ];
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_hardened;
|
||||
|
||||
networking = {
|
||||
hostName = "alexandria";
|
||||
firewall = {
|
||||
allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
9666
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
{ config, pkgs, lib, ...}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# Host-specific imports
|
||||
./hardware-configuration.nix
|
||||
./hosted-services.nix
|
||||
./packages.nix
|
||||
./users.nix
|
||||
<home-manager/nixos>
|
||||
|
||||
];
|
||||
|
||||
swapDevices = [ { device = "/swapfile"; size = 8192; } ];
|
||||
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackages_hardened;
|
||||
loader = {
|
||||
timeout = 1;
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
hostName = "alexandria";
|
||||
firewall = {
|
||||
enable = true;
|
||||
checkReversePath = "loose";
|
||||
allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
9666
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
time.timeZone = "Europe/Berlin";
|
||||
i18n = {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_IE.UTF-8";
|
||||
LC_IDENTIFICATION = "en_IE.UTF-8";
|
||||
LC_MEASUREMENT = "en_IE.UTF-8";
|
||||
LC_MONETARY = "en_IE.UTF-8";
|
||||
LC_NAME = "en_IE.UTF-8";
|
||||
LC_NUMERIC = "en_IE.UTF-8";
|
||||
LC_PAPER = "en_IE.UTF-8";
|
||||
LC_TELEPHONE = "en_IE.UTF-8";
|
||||
LC_TIME = "en_IE.UTF-8";
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
openssh.enable = true;
|
||||
tailscale.enable = true;
|
||||
fstrim.enable = true;
|
||||
};
|
||||
|
||||
nix = {
|
||||
settings.auto-optimise-store = true;
|
||||
extraOptions = "experimental-features = nix-command flakes";
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 8d";
|
||||
};
|
||||
};
|
||||
|
||||
system = {
|
||||
stateVersion = "22.05";
|
||||
autoUpgrade = {
|
||||
enable = true;
|
||||
dates = "weekly";
|
||||
allowReboot = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
nixpkgs.config = {
|
||||
allowUnfree = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
any-nix-shell
|
||||
bind
|
||||
btop
|
||||
git
|
||||
htop
|
||||
lazydocker
|
||||
micro
|
||||
tmux
|
||||
wget
|
||||
];
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
users.users = {
|
||||
user = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "networkmanager" "docker" ];
|
||||
shell = pkgs.fish;
|
||||
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA1v3+q3EaruiiStWjubEJWvtejam/r41uoOpCdwJtLL foxtrot@rotterdam" ];
|
||||
hashedPassword = "";
|
||||
};
|
||||
root.hashedPassword = "!";
|
||||
};
|
||||
}
|
||||
|
|
@ -30,9 +30,9 @@
|
|||
url = "https://raw.githubusercontent.com/baduhai/dotfiles/master/kitty/scroll_mark.py";
|
||||
sha256 = "Abif6LIOCiXyDdQMZ4pQnLK++It0VYIM+WE7Oydwkfo=";
|
||||
};
|
||||
".config/electron-flags.conf".text = "--ozone-platform-hint=auto";
|
||||
# Autostart programs
|
||||
".config/autostart/org.kde.yakuake.desktop".source = config.lib.file.mkOutOfStoreSymlink "/var/run/current-system/sw/share/applications/org.kde.yakuake.desktop";
|
||||
".config/autostart/megasync.desktop".source = config.lib.file.mkOutOfStoreSymlink "/var/run/current-system/sw/share/applications/megasync.desktop";
|
||||
".config/autostart/koi.desktop".source = config.lib.file.mkOutOfStoreSymlink "/var/run/current-system/sw/share/applications/koi.desktop";
|
||||
# Fix flatpak fonts, themes, icons and cursor
|
||||
".icons/breeze_cursors".source = config.lib.file.mkOutOfStoreSymlink "/run/current-system/sw/share/icons/breeze_cursors";
|
||||
|
|
|
|||
|
|
@ -1 +1,9 @@
|
|||
config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# Host-common imports
|
||||
../common/programs.nix
|
||||
../common/home.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue