Initial flake commit
This commit is contained in:
parent
3b11040922
commit
a5a6a02929
|
@ -33,17 +33,17 @@ in {
|
||||||
secret-paths = [ "/state/secrets" ];
|
secret-paths = [ "/state/secrets" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
fudo.games.valheim = {
|
||||||
"L /root/.gnupg - - - - ${state-dir}/user/root/gnupg"
|
enable = true;
|
||||||
# "L /root/.emacs.d - - - - ${state-dir}/user/root/emacs.d"
|
state-directory = "/state/games/valheim";
|
||||||
"L /root/.ssh/id_rsa - - - - ${state-dir}/user/root/ssh/id_rsa"
|
password = "silkymilky";
|
||||||
"L /root/.ssh/id_rsa.pub - - - - ${state-dir}/user/root/ssh/id_rsa.pub"
|
};
|
||||||
"L /root/.ssh/known_hosts - - - - ${state-dir}/user/root/ssh/known_hosts"
|
|
||||||
|
|
||||||
# "L /etc/ssh/ssh_host_rsa_key - - - - ${state-dir}/ssh/ssh_host_rsa_key"
|
systemd.tmpfiles.rules = [
|
||||||
# "L /etc/ssh/ssh_host_rsa_key.pub - - - - ${state-dir}/ssh/ssh_host_rsa_key.pub"
|
"L /root/.gnupg - - - - ${state-dir}/user/root/gnupg"
|
||||||
# "L /etc/ssh/ssh_host_ed25519_key - - - - ${state-dir}/ssh/ssh_host_ed25519_key"
|
"L /root/.ssh/id_rsa - - - - ${state-dir}/user/root/ssh/id_rsa"
|
||||||
# "L /etc/ssh/ssh_host_ed25519_key.pub - - - - ${state-dir}/ssh/ssh_host_ed25519_key.pub"
|
"L /root/.ssh/id_rsa.pub - - - - ${state-dir}/user/root/ssh/id_rsa.pub"
|
||||||
|
"L /root/.ssh/known_hosts - - - - ${state-dir}/user/root/ssh/known_hosts"
|
||||||
];
|
];
|
||||||
|
|
||||||
services.openssh.hostKeys = [
|
services.openssh.hostKeys = [
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
fudo.slynk.enable = true;
|
fudo.slynk.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [ opencv-java worther ];
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
interfaces = {
|
interfaces = {
|
||||||
eno1.useDHCP = false;
|
eno1.useDHCP = false;
|
||||||
|
|
|
@ -43,13 +43,6 @@ in {
|
||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
emacs = {
|
|
||||||
enable = true;
|
|
||||||
install = true;
|
|
||||||
package = pkgs.emacs;
|
|
||||||
defaultEditor = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
trezord.enable = true;
|
trezord.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -52,16 +52,7 @@ in {
|
||||||
|
|
||||||
networking.networkmanager.enable = mkForce false;
|
networking.networkmanager.enable = mkForce false;
|
||||||
|
|
||||||
services = {
|
services = { xserver.enable = false; };
|
||||||
xserver.enable = false;
|
|
||||||
|
|
||||||
emacs = {
|
|
||||||
enable = true;
|
|
||||||
install = true;
|
|
||||||
package = pkgs.emacs;
|
|
||||||
defaultEditor = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
sound.enable = false;
|
sound.enable = false;
|
||||||
hardware.pulseaudio.enable = false;
|
hardware.pulseaudio.enable = false;
|
||||||
|
|
18
flake.nix
18
flake.nix
|
@ -1,7 +1,7 @@
|
||||||
let target-version = "21.05";
|
let target-version = "21.05";
|
||||||
|
|
||||||
in {
|
in {
|
||||||
description = "A very basic flake";
|
description = "Fudo Host Configuration";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "nixpkgs/nixos-${target-version}";
|
nixpkgs.url = "nixpkgs/nixos-${target-version}";
|
||||||
|
@ -20,10 +20,20 @@ in {
|
||||||
hosts = map hostname-from-file (attrNames (filterAttrs is-nix-file
|
hosts = map hostname-from-file (attrNames (filterAttrs is-nix-file
|
||||||
(filterAttrs is-regular-file (builtins.readDir ./config/hosts))));
|
(filterAttrs is-regular-file (builtins.readDir ./config/hosts))));
|
||||||
|
|
||||||
in {
|
pkgs = import nixpkgs { };
|
||||||
nixConfigurations = mapAttrs (host: hostOpts:
|
|
||||||
lib.nixosSystem {
|
|
||||||
|
|
||||||
|
in {
|
||||||
|
nixConfigurations = mapAttrs (hostname: hostOpts:
|
||||||
|
lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [
|
||||||
|
(import ./initialize.nix {
|
||||||
|
hostname = hostname;
|
||||||
|
home-manager-package = home-manager;
|
||||||
|
pkgs = pkgs;
|
||||||
|
include-secrets = true;
|
||||||
|
})
|
||||||
|
];
|
||||||
}) host-configs;
|
}) host-configs;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,8 @@ let
|
||||||
|
|
||||||
doom-emacs = pkgs.callPackage (pkgs.fetchgit {
|
doom-emacs = pkgs.callPackage (pkgs.fetchgit {
|
||||||
url = "https://github.com/vlaci/nix-doom-emacs.git";
|
url = "https://github.com/vlaci/nix-doom-emacs.git";
|
||||||
rev = "3893c50877a9d2d5d4aeee524ba1539f22115f1f";
|
rev = "fee14d217b7a911aad507679dafbeaa8c1ebf5ff";
|
||||||
sha256 = "1jz8mxh143a4470mq303ng6dh3bxi6mcppqli4z0m13qhqssh4fx";
|
sha256 = "1g0izscjh5nv4n0n1m58jc6z27i9pkbxs17mnb05a83ffdbmmva6";
|
||||||
}) {
|
}) {
|
||||||
doomPrivateDir = "${pkgs.doom-emacs-config}";
|
doomPrivateDir = "${pkgs.doom-emacs-config}";
|
||||||
extraPackages = with pkgs.emacsPackages; [ elpher use-package ];
|
extraPackages = with pkgs.emacsPackages; [ elpher use-package ];
|
||||||
|
@ -70,6 +70,7 @@ let
|
||||||
cdrtools
|
cdrtools
|
||||||
cargo
|
cargo
|
||||||
clojure
|
clojure
|
||||||
|
clj2nix
|
||||||
cmake
|
cmake
|
||||||
curl
|
curl
|
||||||
doom-emacs
|
doom-emacs
|
||||||
|
@ -158,7 +159,17 @@ in {
|
||||||
"Xft.lcdfilter" = "lcddefault";
|
"Xft.lcdfilter" = "lcddefault";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.gpg-agent.enable = true;
|
services = {
|
||||||
|
emacs = {
|
||||||
|
enable = true;
|
||||||
|
package = doom-emacs;
|
||||||
|
client = {
|
||||||
|
enable = true;
|
||||||
|
arguments = [ "-t" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
gpg-agent.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
packages =
|
packages =
|
||||||
|
@ -194,23 +205,15 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
".fonts.conf" = { source = ../static/fonts.conf; };
|
# ".fonts.conf" = { source = ../static/fonts.conf; };
|
||||||
};
|
};
|
||||||
|
|
||||||
sessionVariables = {
|
sessionVariables = {
|
||||||
EDITOR = "emacsclient -t";
|
# EDITOR = "${doom-emacs}/bin/emacsclient -t";
|
||||||
ALTERNATE_EDITOR = "";
|
ALTERNATE_EDITOR = "";
|
||||||
|
|
||||||
HISTCONTROL = "ignoredups:ignorespace";
|
HISTCONTROL = "ignoredups:ignorespace";
|
||||||
};
|
};
|
||||||
|
|
||||||
# activation = let
|
|
||||||
# ensure-dir-script = dir: ''
|
|
||||||
# $DRY_RUN_CMD [[ -d "${dir}" ]] || mkdir -p "${dir}"
|
|
||||||
# '';
|
|
||||||
# ensure-dirs-script =
|
|
||||||
# concatStringsSep "\n" (map ensure-dir-script ensure-directories);
|
|
||||||
# in hm.dag.entryAfter [ "writeBoundary" ] ensure-dirs-script;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.tmpfiles.rules =
|
systemd.user.tmpfiles.rules =
|
||||||
|
|
|
@ -43,6 +43,8 @@ with lib; {
|
||||||
./fudo/webmail.nix
|
./fudo/webmail.nix
|
||||||
./fudo/wireless-networks.nix
|
./fudo/wireless-networks.nix
|
||||||
|
|
||||||
|
./fudo/games/valheim.nix
|
||||||
|
|
||||||
./informis/cl-gemini.nix
|
./informis/cl-gemini.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ./valheim.nix ];
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let cfg = config.fudo.games.valheim;
|
||||||
|
in {
|
||||||
|
options.fudo.games.valheim = with types; {
|
||||||
|
enable = mkEnableOption "Enable dedicated Valheim server.";
|
||||||
|
|
||||||
|
state-directory = mkOption {
|
||||||
|
type = str;
|
||||||
|
description = "Directory at which to store Valheim state data.";
|
||||||
|
default = "/var/lib/valheim";
|
||||||
|
};
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
type = port;
|
||||||
|
description = "Port on which to listen for connections.";
|
||||||
|
default = 2456;
|
||||||
|
};
|
||||||
|
|
||||||
|
password = mkOption {
|
||||||
|
type = str;
|
||||||
|
description = "Password required by connecting users.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
users.users.valheim = {
|
||||||
|
home = cfg.state-directory;
|
||||||
|
createHome = true;
|
||||||
|
isSystemUser = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.fudo-valheim = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStartPre = ''
|
||||||
|
[[ -d ${cfg.state-directory}/state ]] || mkdir ${cfg.state-directory}/state
|
||||||
|
${pkgs.steamcmd}/bin/steamcmd \
|
||||||
|
+login anonymous \
|
||||||
|
+force_install_dir ${cfg.state-directory}/state \
|
||||||
|
+app_update 896660 \
|
||||||
|
+quit
|
||||||
|
'';
|
||||||
|
|
||||||
|
ExecStart = ''
|
||||||
|
${pkgs.glibc}/lib/ld-linux-x86-64.so.2 ./valheim_server.x86_64 \
|
||||||
|
-name "CoCo Valheim" \
|
||||||
|
-port ${toString cfg.port} \
|
||||||
|
-world "Dedicated" \
|
||||||
|
-password ${cfg.password} \
|
||||||
|
-public 1
|
||||||
|
'';
|
||||||
|
Nice = -5;
|
||||||
|
Restart = "always";
|
||||||
|
User = "valheim";
|
||||||
|
StateDirectory = "${cfg.state-directory}/state";
|
||||||
|
WorkingDirectory = cfg.state-directory;
|
||||||
|
};
|
||||||
|
environment = { LD_LIBRARY_PATH = "linux64:${pkgs.glibc}/lib"; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -68,8 +68,9 @@ in {
|
||||||
|
|
||||||
opencv-java = pkgs.opencv.overrideAttrs (oldAttrs: rec {
|
opencv-java = pkgs.opencv.overrideAttrs (oldAttrs: rec {
|
||||||
# buildInputs = oldAttrs.buildInputs ++ [ pkgs.ant ];
|
# buildInputs = oldAttrs.buildInputs ++ [ pkgs.ant ];
|
||||||
|
pname = "opencv-java";
|
||||||
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ pkgs.jdk11 pkgs.ant ];
|
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ pkgs.jdk11 pkgs.ant ];
|
||||||
# cmakeFlags = oldAttrs.cmakeFlags ++ [ "-DWITH_JAVA=ON" ];
|
cmakeFlags = oldAttrs.cmakeFlags ++ [ "-DWITH_JAVA=ON" ];
|
||||||
});
|
});
|
||||||
|
|
||||||
hll2380dw-cups = import ./hll2380dw-cups.nix {
|
hll2380dw-cups = import ./hll2380dw-cups.nix {
|
||||||
|
@ -176,5 +177,11 @@ in {
|
||||||
rev = "278a90f7ce219e36e5de0a80b540e469a9bce912";
|
rev = "278a90f7ce219e36e5de0a80b540e469a9bce912";
|
||||||
sha256 = "06qns3ayc84mamdgn0jw652rvx60wy9km1vxm2361mzmx2zk89iw";
|
sha256 = "06qns3ayc84mamdgn0jw652rvx60wy9km1vxm2361mzmx2zk89iw";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
clj2nix = pkgs.callPackage (pkgs.fetchgit {
|
||||||
|
url = "https://github.com/hlolli/clj2nix.git";
|
||||||
|
rev = "e6d09dd8c5cda68eb0534bd8501f2d5dcd7b2e95";
|
||||||
|
sha256 = "0v0q6iglr0lx13j1snzd8mjxids1af1p2h7bkvmsyk2bfp36naqx";
|
||||||
|
}) { };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue