updated postgres

This commit is contained in:
Sam 2024-09-09 11:41:10 +01:00
parent 564d4f6230
commit a8e0ae35da
8 changed files with 160 additions and 125 deletions

View File

@ -1,6 +1,4 @@
{ config
, ...
}: {
{config, ...}: {
imports = [
# Import users
./users/sam
@ -15,7 +13,6 @@
./common/optional/desktop/common/themes/standard-dark.nix
./common/optional/notes.nix
./common/optional/yazi.nix
];
colorScheme = {

View File

@ -17,5 +17,6 @@
pkgs.transmission
pkgs.qgis
pkgs.mpv
pkgs.gnome.simple-scan
];
}

View File

@ -1,27 +1,48 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
# Prevent error when enabling gtk https://github.com/nix-community/home-manager/issues/3113
# error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files
home.packages = [
pkgs.dconf
pkgs.vimix-cursor-theme
];
gtk.enable = true;
home.file.".icons/default".source = "${pkgs.vimix-cursor-theme}/share/icons/Vimix-Cursors";
# Get details about theme package
#cd $(nix build nixpkgs#kanagawa-gtk-theme --print-out-paths --no-link) && nix run nixpkgs#eza -- --tree --level 4
gtk.theme.package = pkgs.kanagawa-gtk-theme;
gtk.cursorTheme = {
name = "Vimix-Cursors";
package = pkgs.vimix-cursor-theme;
gtk = {
enable = true;
theme = {
name = "Kanagawa-B";
package = pkgs.kanagawa-gtk-theme;
};
iconTheme = {
package = pkgs.gnome.adwaita-icon-theme;
name = "Adwaita";
};
gtk.theme.name = "Kanagawa-B";
gtk3.extraConfig = {
Settings = ''
gtk-application-prefer-dark-theme=1
'';
};
gtk.iconTheme.package = pkgs.kanagawa-icon-theme;
gtk.iconTheme.name = "Kanagawa";
gtk4.extraConfig = {
Settings = ''
gtk-application-prefer-dark-theme=1
'';
};
};
#gtk.theme.package = pkgs.kanagawa-gtk-theme;
# gtk.cursorTheme = {
# name = "Vimix-Cursors";
# package = pkgs.vimix-cursor-theme;
# };
# gtk.theme.name = "Kanagawa-B";
# gtk.iconTheme.package = pkgs.kanagawa-icon-theme;
# gtk.iconTheme.name = "Kanagawa";
qt.enable = true;
qt.platformTheme.name = "gtk";

View File

@ -1,6 +1,7 @@
{ pkgs
, config
, ...
{
pkgs,
config,
...
}: {
imports = [
# Import users
@ -16,7 +17,6 @@
./common/optional/desktop/common/themes/standard-dark.nix
./common/optional/notes.nix
./common/optional/yazi.nix
];
colorScheme = {
@ -43,14 +43,6 @@
};
};
home.pointerCursor = {
x11.enable = true;
name = "Vimix-Cursors";
package = pkgs.vimix-cursor-theme;
size = 64;
gtk.enable = true;
};
xresources.extraConfig = ''
! st
st.alpha: 0.8
@ -84,5 +76,4 @@
Nsxiv.bar.foreground: #${config.colorScheme.colors.base05}
Nsxiv.bar.font: monospace:size=12
'';
}

View File

@ -1,6 +1,6 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
services = {
udev.packages = [pkgs.sane-airscan];
printing = {
enable = true;
drivers = [pkgs.gutenprint pkgs.hplip];
@ -11,7 +11,14 @@
openFirewall = true;
};
};
hardware.printers = {
hardware = {
sane = {
enable = true;
extraBackends = [pkgs.sane-airscan];
netConf = "10.0.10.2";
};
printers = {
ensurePrinters = [
{
name = "HP_ENVY_6000";
@ -25,4 +32,5 @@
}
];
};
};
}

View File

@ -1,22 +1,26 @@
{ pkgs, inputs, config, lib, ... }:
let
{
pkgs,
inputs,
config,
lib,
...
}: let
username = "media";
pubKeys = lib.filesystem.listFilesRecursive (../keys);
pubKeys = lib.filesystem.listFilesRecursive ../keys;
hostname = config.networking.hostName;
sopsHashedPasswordFile = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."passwords/${username}".path;
secretsDirectory = builtins.toString inputs.nix-secrets;
secretsFile = "${secretsDirectory}/secrets.yaml";
in
{
in {
users.users.${username} = {
isNormalUser = true;
shell = pkgs.zsh; # default shell
hashedPasswordFile = sopsHashedPasswordFile;
openssh.authorizedKeys.keys = lib.lists.forEach pubKeys (key: builtins.readFile key);
extraGroups =
[
extraGroups = [
"scanner"
"lp"
"wheel"
];
@ -65,13 +69,11 @@ in
# The containing ssh folders are created as root and if this is the first ~/.ssh/ entry when writing keys,
# the ownership is busted and home-manager can't target because it can't write into .ssh...
# FIXME: We might not need this depending on how https://github.com/Mic92/sops-nix/issues/381 is fixed
system.activationScripts.sopsSetSshOwnwership =
let
system.activationScripts.sopsSetSshOwnwership = let
sshFolder = "/home/${username}/.ssh";
user = config.users.users.${username}.name;
group = config.users.users.${username}.group;
in
''
in ''
mkdir -p ${sshFolder} || true
chown -R ${user}:${group} /home/${username}/.ssh
'';

View File

@ -1,13 +1,17 @@
{ pkgs, inputs, config, lib, ... }:
let
{
pkgs,
inputs,
config,
lib,
...
}: let
hostname = config.networking.hostName;
pubKeys = lib.filesystem.listFilesRecursive (../keys);
pubKeys = lib.filesystem.listFilesRecursive ../keys;
sopsHashedPasswordFile = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."passwords/sam".path;
secretsDirectory = builtins.toString inputs.nix-secrets;
secretsFile = "${secretsDirectory}/secrets.yaml";
username = "sam";
in
{
in {
users.users.${username} = {
isNormalUser = true;
shell = pkgs.zsh; # default shell
@ -17,8 +21,9 @@ in
extraGroups = [
"wheel"
"networkmanager"
"scanner"
"lp"
];
};
sops.secrets = {
@ -115,13 +120,11 @@ in
# The containing folders are created as root and if this is the first entry when writing files,
# the ownership is busted and home-manager can't target because it can't write to these dirs...
# FIXME: We might not need this depending on how https://github.com/Mic92/sops-nix/issues/381 is fixed
system.activationScripts.sopsSetOwnwership =
let
system.activationScripts.sopsSetOwnwership = let
sshFolder = "/home/${username}/.ssh";
user = config.users.users.${username}.name;
group = config.users.users.${username}.group;
in
''
in ''
mkdir -p ${sshFolder} || true
chown -R ${user}:${group} /home/${username}/.ssh
'';

View File

@ -1,25 +1,38 @@
{ inputs, lib, pkgs, ... }:
let
{
inputs,
lib,
pkgs,
...
}: let
# Disko setup
fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence
dev = "/dev/nvme0n1"; # depends on target hardware
encrypted = true; # currrently only applies to btrfs
btrfsMountDevice = if encrypted then "/dev/mapper/crypted" else "/dev/root_vg/root";
btrfsMountDevice =
if encrypted
then "/dev/mapper/crypted"
else "/dev/root_vg/root";
user = "sam";
impermanence = true;
in
{
imports =
[
in {
imports = [
# Create users for this host
../common/users/${user}
# Disk configuration
inputs.disko.nixosModules.disko
(import ../common/disks { device = dev; impermanence = impermanence; fsType = fsType; encrypted = encrypted; })
(import ../common/disks {
device = dev;
impermanence = impermanence;
fsType = fsType;
encrypted = encrypted;
})
# Impermanence
(import ../common/disks/btrfs/impermanence.nix { btrfsMountDevice = btrfsMountDevice; lib = lib; })
(import ../common/disks/btrfs/impermanence.nix {
btrfsMountDevice = btrfsMountDevice;
lib = lib;
})
# Import core options
./hardware-configuration.nix
@ -33,7 +46,6 @@ in
../common/optional/nfs-mounts/media.nix
../common/optional/nfs-mounts/homeshare.nix
../common/optional/printing.nix
];
boot = {