Skip to content

Commit

Permalink
New hamster
Browse files Browse the repository at this point in the history
  • Loading branch information
averyanalex committed Jan 18, 2025
1 parent 99e5f75 commit e1c167c
Show file tree
Hide file tree
Showing 7 changed files with 173 additions and 52 deletions.
6 changes: 3 additions & 3 deletions machines/hamster/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
inputs.self.nixosModules.profiles.netman
inputs.self.nixosModules.profiles.libvirt
inputs.self.nixosModules.profiles.secureboot
inputs.self.nixosModules.profiles.pmbootstrap
# inputs.self.nixosModules.profiles.pmbootstrap
# inputs.self.nixosModules.profiles.remote-builder-client

inputs.self.nixosModules.hardware.thinkbook
Expand All @@ -21,7 +21,7 @@
persist.tmpfsSize = "6G";

services.tlp = {
enable = true;
# enable = true;
settings = {
STOP_CHARGE_THRESH_BAT0 = 0;
};
Expand All @@ -38,5 +38,5 @@
SuspendEstimationSec=15m
'';

system.stateVersion = "23.11";
system.stateVersion = "24.11";
}
34 changes: 24 additions & 10 deletions machines/hamster/mounts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,23 @@
fileSystems."/persist" = {
device = "/dev/hamster/data";
fsType = "btrfs";
options = ["discard=async" "compress=zstd"];
options = ["discard=async" "compress=zstd" "subvol=@"];
};

fileSystems."/persist/home" = {
device = "/dev/hamster/data";
fsType = "btrfs";
options = ["discard=async" "compress=zstd" "subvol=@home"];
};

fileSystems."/nix" = {
device = "/dev/hamster/data";
fsType = "btrfs";
options = ["discard=async" "compress=zstd" "subvol=@nix"];
};

persist.linkNix = false;

# services.beesd.filesystems = {
# tank = {
# spec = "UUID=1c6b1fc4-5a65-43e9-bef3-db168f6bbd0d";
Expand All @@ -16,17 +30,17 @@
# };
# };

services.snapper.configs = {
persist = {
SUBVOLUME = "/persist";
ALLOW_USERS = ["alex"];
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
};
};
# services.snapper.configs = {
# persist = {
# SUBVOLUME = "/persist";
# ALLOW_USERS = ["alex"];
# TIMELINE_CREATE = true;
# TIMELINE_CLEANUP = true;
# };
# };

fileSystems."/boot" = {
device = "/dev/disk/by-uuid/0B94-3F5F";
device = "/dev/nvme0n1p1";
fsType = "vfat";
};

Expand Down
7 changes: 6 additions & 1 deletion modules/persist.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ in {
persist = {
enable = mkEnableOption "tmpfs root with opt-in state";

linkNix = mkOption {
type = bool;
default = true;
};

hideMounts = mkOption {
type = bool;
default = false;
Expand Down Expand Up @@ -96,7 +101,7 @@ in {
neededForBoot = true;
};

boot.initrd.postMountCommands = ''
boot.initrd.postMountCommands = mkIf cfg.linkNix ''
mkdir -p /mnt-root/nix
mount --bind /mnt-root${cfg.persistRoot}/nix /mnt-root/nix
chmod 755 /mnt-root
Expand Down
32 changes: 16 additions & 16 deletions profiles/apps/misc-a.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,27 +83,27 @@
# ];

persist.state.homeDirs = [
".config/Element"
".config/WebCord"
".local/share/TelegramDesktop"
# ".config/Element"
# ".config/WebCord"
# ".local/share/TelegramDesktop"
".config/obs-studio"

"Monero"
".bitmonero"
".config/monero-project"
# "Monero"
# ".bitmonero"
# ".config/monero-project"

".config/Joplin"
".config/joplin-desktop"
".local/share/OpenBoard"
".config/xournalpp"
".config/obsidian"
# ".config/Joplin"
# ".config/joplin-desktop"
# ".local/share/OpenBoard"
# ".config/xournalpp"
# ".config/obsidian"

".local/share/tor-browser"
# ".local/share/tor-browser"

".config/PrusaSlicer"
# ".config/PrusaSlicer"

".config/kicad"
".local/share/kicad"
".config/BraveSoftware"
# ".config/kicad"
# ".local/share/kicad"
# ".config/BraveSoftware"
];
}
8 changes: 4 additions & 4 deletions profiles/mail.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
};
};

home.packages = with pkgs; [
deltachat-desktop
];
# home.packages = with pkgs; [
# deltachat-desktop
# ];
};

persist.state.homeDirs = [".thunderbird" ".config/DeltaChat"];
persist.state.homeDirs = [".thunderbird"]; # ".config/DeltaChat"
}
37 changes: 19 additions & 18 deletions roles/desktop.nix → roles/desktop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
}: {
imports =
[
./full.nix
../dev
../profiles/apps/wezterm.nix
../full.nix
../../dev
../../profiles/apps/wezterm.nix
./gnome.nix
]
++ (with inputs.self.nixosModules.profiles;
with apps;
Expand All @@ -19,24 +20,24 @@
]
++ (with games; [
minecraft
xonotic
# xonotic
])
++ (with gui; [
# nix-colors
# stylix
# sway
clipboard
eww
portals
rofi
# clipboard
# eww
# portals
# rofi
# sway
hyprland
hyprlock
swaync
swayosd
swww
waybar
wm
# hyprland
# hyprlock
# swaync
# swayosd
# swww
# waybar
# wm
])
++ [
# jupyter
Expand All @@ -54,7 +55,7 @@
sdr
sync
tank
waydroid
# waydroid
opensnitch
xray
]);
Expand Down Expand Up @@ -89,8 +90,8 @@
programs.adb.enable = true;

programs.wireshark.enable = true;
environment.systemPackages = [pkgs.wireshark pkgs.openfortivpn pkgs.fork.wireguard-tools pkgs.fork.amneziawg-tools];
systemd.packages = [pkgs.fork.amneziawg-tools];
environment.systemPackages = [pkgs.wireshark pkgs.openfortivpn];
# systemd.packages = [pkgs.fork.amneziawg-tools];
# programs.nix-ld.enable = true;

programs.nh = {
Expand Down
101 changes: 101 additions & 0 deletions roles/desktop/gnome.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{pkgs, ...}: {
nixcfg.gnome.enable = true;
services.xserver = {
xkb.layout = "us,ru";
xkb.options = "grp:caps_toggle,grp_led:scroll";
};

environment.pathsToLink = ["/share/xdg-desktop-portal" "/share/applications"];

xdg.portal = {
# extraPortals = [pkgs.xdg-desktop-portal-gnome];
xdgOpenUsePortal = true;
};

hm = {
# home.packages = with pkgs; [
# # screenshots
# grim
# slurp

# # icons
# adwaita-icon-theme
# libsForQt5.breeze-icons

# # keyring
# seahorse
# gcr
# ];

services.gpg-agent.pinentryPackage = pkgs.pinentry-gnome3;
services.gnome-keyring.enable = true;

dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
"org/gnome/mutter" = {
experimental-features = ["scale-monitor-framebuffer" "x11-randr-fractional-scaling"];
};

"org/gnome/desktop/peripherals/touchpad" = {
tap-to-click = true;
};
# "org/gnome/desktop/wm/preferences" = {
# button-layout = "appmenu:minimize,maximize,close";
# };
# "org/gnome/desktop/interface" = {
# font-antialiasing = "rgba";
# };
# "org/gnome/shell" = {
# enabled-extensions = ["[email protected]"];
# favorite-apps = [
# "org.gnome.Console.desktop"
# "org.gnome.Calendar.desktop"
# "thunderbird.desktop"
# "org.gnome.Nautilus.desktop"
# "firefox.desktop"
# ];
# };
};

home.pointerCursor = {
gtk.enable = true;
x11.enable = true;
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 16;
};

gtk = {
enable = true;

theme = {
name = "Adwaita-dark";
package = pkgs.gnome-themes-extra;
};

iconTheme = {
package = pkgs.adwaita-icon-theme;
name = "Adwaita";
};
};

qt = {
enable = true;
style.name = "adwaita-dark";
};
};

persist.state.homeDirs = [".local/share/keyrings"];

programs.dconf.enable = true;

environment.gnome.excludePackages = with pkgs; [
geary
gnome-calendar
epiphany
];

# programs.gnome-disks.enable = false;
}

0 comments on commit e1c167c

Please sign in to comment.