hook flake update instead
This commit is contained in:
parent
219c50e52d
commit
c2467fd2e2
8 changed files with 25 additions and 269 deletions
|
|
@ -1,13 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ ./hardware-configuration.nix ];
|
||||
networking.hostName = "alisceon-core";
|
||||
boot.initrd.enable = true;
|
||||
boot.loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
}; # end loader.systemd-boot
|
||||
}; # end boot
|
||||
} # end file
|
||||
|
|
@ -1,115 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
hugoDir = "/home/alisceon/blog";
|
||||
in
|
||||
{
|
||||
imports =
|
||||
[ ./hardware-configuration.nix ];
|
||||
networking.hostName = "blogbox";
|
||||
boot.initrd.enable = true;
|
||||
boot.loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
}; # end loader.systemd-boot
|
||||
}; # end boot
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 22 80 443 ];
|
||||
allowedUDPPorts = [ 443 ];
|
||||
};
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
hugo
|
||||
caddy
|
||||
ddclient
|
||||
]; # end systemPackages
|
||||
}; # end environment
|
||||
systemd = {
|
||||
services = {
|
||||
"pull-blog" = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
script = ''
|
||||
git pull origin main
|
||||
hugo
|
||||
'';
|
||||
serviceConfig = {
|
||||
type = "oneshot";
|
||||
user = "alisceon";
|
||||
workingDirectory = hugoDir;
|
||||
}; # end serviceConfig
|
||||
}; # end pull-blog
|
||||
"ddclient" = {
|
||||
description = "Dynamic DNS client";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.ddclient}/bin/ddclient -foreground -file /etc/blogbox/ddclient.conf";
|
||||
Restart = "on-failure";
|
||||
User = "root";
|
||||
EnvironmentFile = "/etc/blogbox/.env";
|
||||
}; # end serviceConfig
|
||||
}; # end ddclient
|
||||
}; # end services
|
||||
timers = {
|
||||
"pull-blog" = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnBootSec = "5min";
|
||||
OnUnitActiveSec = "5min";
|
||||
Persistent = true;
|
||||
}; # end timerConfig
|
||||
}; # end pull-blog
|
||||
"ddclient" = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnBootSec = "5min";
|
||||
OnUnitActiveSec = "5min";
|
||||
Persistent = true;
|
||||
}; # end timerConfig
|
||||
}; # end ddclient
|
||||
}; # end timers
|
||||
}; # end systemd
|
||||
services= {
|
||||
caddy = {
|
||||
enable = true;
|
||||
environmentFile = "/etc/blogbox/.env";
|
||||
virtualHosts = {
|
||||
"blog" = {
|
||||
hostName = "${DOMAIN}";
|
||||
forceSSL = true;
|
||||
root = "${hugoDir}/public";
|
||||
index = "index.html";
|
||||
log = [ "stdout" "stderr" ];
|
||||
fileServer = { };
|
||||
tls = {
|
||||
email = ""
|
||||
}; # end tls
|
||||
}; # end {$DOMAIN}
|
||||
}; # end virtualHosts
|
||||
}; # end caddy
|
||||
}; # end services.caddy
|
||||
environment = {
|
||||
etc = {
|
||||
"blogbox/ddclient.conf" = {
|
||||
text = ''
|
||||
use=web, web=dynamicdns.park-your-domain.com/getip
|
||||
protocol=namecheap
|
||||
server=dynamicdns.park-your-domain.com
|
||||
login_env=DOMAIN
|
||||
password_env=DDNS_PASSWORD
|
||||
@
|
||||
'';
|
||||
mode = "600";
|
||||
};
|
||||
"blogbox/.env.example" = {
|
||||
text = ''
|
||||
HUGO_DIR=${hugoDir}
|
||||
HUGO_ENV=production
|
||||
DOMAIN=example.com
|
||||
DDNS_PASSWORD=yourpassword
|
||||
NAMECHEAP_API_KEY=yourapikey
|
||||
'';
|
||||
mode = "600";
|
||||
};
|
||||
}; # end etc
|
||||
};
|
||||
} # end file
|
||||
131
hosts/common.nix
131
hosts/common.nix
|
|
@ -1,131 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
system.stateVersion = "24.05";
|
||||
nix.settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
auto-optimise-store = true;
|
||||
trusted-users = [ "root" "alisceon" ];
|
||||
}; # end nix settings
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 7d";
|
||||
}; # end nix gc
|
||||
|
||||
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
|
||||
|
||||
environment.gnome.excludePackages = with pkgs; [
|
||||
evolution
|
||||
geary
|
||||
gnome-contacts
|
||||
gnome-music
|
||||
gnome-user-docs
|
||||
gnome-tour
|
||||
gnome-weather
|
||||
gnome-maps
|
||||
gnome-calendar
|
||||
gnome-initial-setup
|
||||
gnome-clocks
|
||||
];
|
||||
|
||||
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
|
||||
ripgrep
|
||||
bat
|
||||
fd
|
||||
eza
|
||||
bash
|
||||
|
||||
# Chat
|
||||
discord
|
||||
signal-desktop
|
||||
|
||||
# Browser
|
||||
firefox
|
||||
|
||||
# Development
|
||||
vscode
|
||||
devenv
|
||||
direnv
|
||||
|
||||
# Virtualization
|
||||
podman
|
||||
|
||||
# GNOME tweaks and extensions
|
||||
gnome-tweaks
|
||||
dconf-editor
|
||||
gnomeExtensions.ddterm
|
||||
|
||||
# Other
|
||||
syncthing
|
||||
steam
|
||||
krita
|
||||
edk2-uefi-shell
|
||||
obsidian
|
||||
];
|
||||
environment.shells = with pkgs; [ fish ];
|
||||
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
dockerCompat = true;
|
||||
defaultNetwork.settings.dns_enabled = true;
|
||||
};
|
||||
|
||||
users.users.alisceon = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "networkmanager" "podman" ];
|
||||
shell = pkgs.fish;
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue