WIP: x13s: install to nvme, refactor into module
This commit is contained in:
parent
40416bd4de
commit
a083c05b27
28 changed files with 1361 additions and 737 deletions
|
@ -1,101 +1,30 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, repoFlake
|
||||
# TODO: make configurable
|
||||
, homeUser ? "steveej"
|
||||
, repoFlakeInputs'
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
radicalePkgs = repoFlake.inputs.radicale-nixpkgs.legacyPackages.${pkgs.system};
|
||||
|
||||
libdecsync = pkgs.python3Packages.buildPythonPackage rec {
|
||||
pname = "libdecsync";
|
||||
version = "2.2.1";
|
||||
|
||||
src = pkgs.python3Packages.fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-Mukjzjumv9VL+A0maU0K/SliWrgeRjAeiEdN5a83G0I=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
# pkgs.libxcrypt-legacy
|
||||
];
|
||||
};
|
||||
radicale-storage-decsync = pkgs.python3Packages.buildPythonPackage rec {
|
||||
pname = "radicale_storage_decsync";
|
||||
version = "2.1.0";
|
||||
|
||||
src = pkgs.python3Packages.fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-X+0MT5o2PjsKxca5EDI+rYyQDmUtbRoELDr6e4YXKCg=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
pkgs.radicale
|
||||
# pkgs.libxcrypt-legacy
|
||||
# pkgs.libxcrypt
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
# pkgs.libxcrypt-legacy
|
||||
# pkgs.libxcrypt
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [ libdecsync pkgs.python3Packages.setuptools ];
|
||||
};
|
||||
radicale-decsync = pkgs.radicale.overrideAttrs (old: {
|
||||
propagatedBuildInputs =
|
||||
old.propagatedBuildInputs
|
||||
++ [ radicale-storage-decsync ];
|
||||
});
|
||||
|
||||
mkRadicaleService =
|
||||
{ suffix
|
||||
, port
|
||||
,
|
||||
}:
|
||||
let
|
||||
radicale-config = pkgs.writeText "radicale-config-${suffix}" ''
|
||||
[server]
|
||||
hosts = localhost:${builtins.toString port}
|
||||
|
||||
[auth]
|
||||
type = htpasswd
|
||||
htpasswd_filename = ${config.sops.secrets.radicale_htpasswd.path}
|
||||
htpasswd_encryption = bcrypt
|
||||
|
||||
[storage]
|
||||
type = radicale_storage_decsync
|
||||
filesystem_folder = ${config.xdg.dataHome}/radicale-${suffix}
|
||||
decsync_dir = ${config.xdg.dataHome}/decsync-${suffix}
|
||||
'';
|
||||
in
|
||||
{
|
||||
home-manager.users.${homeUser}.systemd.user.services."radicale-${suffix}" = {
|
||||
Unit.Description = "Radicale with DecSync (${suffix})";
|
||||
Service = {
|
||||
ExecStart = "${radicale-decsync}/bin/radicale -C ${radicale-config}";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
};
|
||||
};
|
||||
# TODO: make configurable
|
||||
homeUser = "steveej";
|
||||
in
|
||||
{
|
||||
sops.secrets.radicale_htpasswd = {
|
||||
sopsFile = ../../../../secrets/desktop/radicale_htpasswd;
|
||||
sopsFile = ../../../secrets/desktop/radicale_htpasswd;
|
||||
format = "binary";
|
||||
owner = config.users.users.${homeUser}.name;
|
||||
owner = config.users.users."${homeUser}".name;
|
||||
};
|
||||
} // (builtins.foldl' (sum: cur: lib.recursiveUpdate sum (mkRadicaleService cur)) { } [
|
||||
{
|
||||
suffix = "personal";
|
||||
port = 5232;
|
||||
}
|
||||
{
|
||||
suffix = "family";
|
||||
port = 5233;
|
||||
}
|
||||
])
|
||||
|
||||
home-manager.users.${homeUser} = _: {
|
||||
imports = [
|
||||
# TODO: bump these to latest and make it work
|
||||
(args:
|
||||
import ../../home-manager/programs/radicale.nix (args // {
|
||||
osConfig = config;
|
||||
pkgs = repoFlakeInputs'.radicalePkgs.legacyPackages;
|
||||
})
|
||||
)
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
90
nix/os/snippets/sway-desktop.nix
Normal file
90
nix/os/snippets/sway-desktop.nix
Normal file
|
@ -0,0 +1,90 @@
|
|||
{ pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
# TODO: make this configurable
|
||||
homeUser = "steveej";
|
||||
in
|
||||
{
|
||||
services.xserver.serverFlagsSection = ''
|
||||
Option "BlankTime" "0"
|
||||
Option "StandbyTime" "0"
|
||||
Option "SuspendTime" "0"
|
||||
Option "OffTime" "0"
|
||||
'';
|
||||
|
||||
hardware.opengl.enable = true;
|
||||
|
||||
services.gvfs = {
|
||||
enable = true;
|
||||
package = lib.mkForce pkgs.gnome3.gvfs;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# provides a default authentification client for policykit
|
||||
lxqt.lxqt-policykit
|
||||
];
|
||||
|
||||
# required by swaywm
|
||||
security.polkit.enable = true;
|
||||
security.pam.services.swaylock = { };
|
||||
|
||||
# test these on https://mozilla.github.io/webrtc-landing/gum_test.html
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
# FIXME: `true` breaks xdg-open from alacritty:
|
||||
# $ xdg-open "https://github.com/"
|
||||
# Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.OpenURI” on object at path /org/freedesktop/portal/desktop
|
||||
xdgOpenUsePortal = false;
|
||||
extraPortals = [
|
||||
pkgs.xdg-desktop-portal-wlr
|
||||
pkgs.xdg-desktop-portal-gtk
|
||||
|
||||
# repoFlake.inputs.nixpkgs-wayland.packages.${pkgs.system}.xdg-desktop-portal-wlr
|
||||
# (pkgs.xdg-desktop-portal-gtk.override (_: {
|
||||
# buildPortalsInGnome = false;
|
||||
# }))
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
# rtkit is optional but recommended
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
audio.enable = true;
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# If you want to use JACK applications, uncomment this
|
||||
#jack.enable = true;
|
||||
};
|
||||
|
||||
networkmanager.enable = false;
|
||||
|
||||
security.pam.services.getty.enableGnomeKeyring = true;
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
# autologin steveej on tty1
|
||||
systemd.services."autovt@tty1".description = "Autologin at the TTY1";
|
||||
systemd.services."autovt@tty1".after = [ "systemd-logind.service" ]; # without it user session not started and xorg can't be run from this tty
|
||||
systemd.services."autovt@tty1".wantedBy = [ "multi-user.target" ];
|
||||
systemd.services."autovt@tty1".serviceConfig =
|
||||
{
|
||||
ExecStart = [
|
||||
"" # override upstream default with an empty ExecStart
|
||||
"@${pkgs.utillinux}/sbin/agetty agetty --login-program ${pkgs.shadow}/bin/login --autologin steveej --noclear %I $TERM"
|
||||
];
|
||||
Restart = "always";
|
||||
Type = "idle";
|
||||
};
|
||||
programs.zsh.loginShellInit = ''
|
||||
if test $(id --user steveej) = $(id -u) && test $(tty) = "/dev/tty1"; then
|
||||
exec sway
|
||||
fi
|
||||
'';
|
||||
|
||||
home-manager.users.${homeUser} = _: {
|
||||
imports = [
|
||||
../../home-manager/profiles/sway-desktop.nix
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue