cosmic checkpoint

This commit is contained in:
atagen 2024-08-14 01:01:53 +10:00
parent 4031a614a8
commit f623faa0ef
26 changed files with 1163 additions and 538 deletions

View file

@ -12,6 +12,9 @@
./configuration.nix
];
nix.settings.trusted-users = ["plank"];
programs.nh.flake = "/home/plank/.nix";
boot.kernelParams = [
"mitigations=off"
"quiet"

View file

@ -17,7 +17,6 @@
outputs.overlays.rice
inputs.helix.overlays.default
inputs.nixd.overlays.default
inputs.nix-ld-rs.overlays.default
];
config = {
allowUnfree = true;
@ -29,7 +28,7 @@
# add flake inputs to our registry to allow global use
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
settings = {
trusted-users = ["bolt" "plank"];
# trusted-users = ["bolt" "plank"];
experimental-features = "nix-command flakes";
substitute = true;
};
@ -37,11 +36,6 @@
keep-outputs = true
keep-derivations = true
'';
gc = {
automatic = true;
dates = "daily";
options = "--delete-older-than 3d";
};
optimise.automatic = true;
package = pkgs.lix;
};
@ -64,8 +58,11 @@
services.libinput.enable = true;
hardware.opengl.enable = true;
hardware.opengl.driSupport32Bit = true;
# busted as hell
# services.usbmuxd.enable = true; # for iphone
hardware.graphics.enable = true;
hardware.graphics.enable32Bit = true;
services.udisks2.enable = true;
@ -82,10 +79,20 @@
curl
eza
git
# broken \/
# libimobiledevice
# ifuse
];
services.atuin.enable = true;
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 3d --keep 3";
};
programs.nix-index-database.comma.enable = true;
programs.nix-index.enableZshIntegration = false;
programs.nix-index.enableBashIntegration = false;
@ -94,13 +101,7 @@
programs.dconf.enable = true;
services.gvfs.enable = true;
programs.nix-ld = {
enable = true;
package = pkgs.nix-ld-rs;
};
# give cpuset to user
systemd.services."user@".serviceConfig.Delegate = "memory pids cpu cpuset";
system.stateVersion = "22.11"; # Did you read the comment?
systemd.user.extraConfig = "LogLevel=debug";
}

View file

@ -1,114 +1,6 @@
{
pkgs,
lib,
...
}: let
inherit (lib) range mapAttrsToList;
inherit (builtins) toString;
workspaceRange = range 1 6;
makeWorkspaceBinding = modifiers: action:
map (i: {
inherit modifiers;
key = toString i;
action = {
type = action;
data = i;
};
})
workspaceRange;
focusWsBindings = makeWorkspaceBinding ["Super"] "Workspace";
moveWsBindings = makeWorkspaceBinding ["Super" "Shift"] "SendToWorkspace";
hjkl = {
"h" = "Left";
"j" = "Down";
"k" = "Up";
"l" = "Right";
};
makeDirBinding = modifiers: action:
mapAttrsToList (
key: dir: {
inherit key modifiers;
action = {
type = action;
data = dir;
};
}
)
hjkl;
focusBindings = makeDirBinding ["Super"] "Focus";
moveBindings = makeDirBinding ["Super" "Shift"] "Move";
winManagementBindings =
focusWsBindings
++ moveWsBindings
++ focusBindings
++ moveBindings;
genBinding = key: modifiers: action: {
inherit key modifiers action;
};
genSpawnBinding = key: modifiers: app: {
inherit key modifiers;
action = {
type = "Spawn";
data = app;
};
};
in {
imports = [
../../util/cosmic.nix
];
{pkgs, ...}: {
services.desktopManager.cosmic = {
enable = true;
otherSettings = {
"com.system76.CosmicPanel.Dock" = {
option.opacity = 0.8;
};
};
keybindings =
winManagementBindings
++ [
(genBinding "q" ["Super" "Shift"] "Close")
(genBinding "w" ["Super"] "ToggleStacking")
(genBinding "s" ["Super"] "ToggleOrientation")
(genBinding "space" ["Super"] "ToggleWindowFloating")
(genBinding "space" ["Super" "Shift"] "Maximize")
(genBinding "minus" ["Super"] "Minimize")
(genBinding "r" ["Super"] {
type = "Resizing";
data = "Outwards";
})
(genBinding "r" ["Super" "Shift"] {
type = "Resizing";
data = "Inwards";
})
(genBinding "tab" ["Super"] "NextOutput")
(genBinding "tab" ["Super" "Shift"] "MoveToNextOutput")
(genBinding "grave" ["Super"] "PreviousOutput")
(genBinding "grave" ["Super" "Shift"] "MoveToPreviousOutput")
(genSpawnBinding "f" ["Super"] "firefox")
(genSpawnBinding "e" ["Super"] "nautilus")
(genSpawnBinding "equal" ["Super"] "keepassxc")
(genSpawnBinding "return" ["Super"] "kitty")
(genSpawnBinding "s" ["Super" "Shift"] "cosmic-screenshot")
(genSpawnBinding null ["Super"] "cosmic-launcher")
(genSpawnBinding "d" ["Super"] "cosmic-app-library")
(genSpawnBinding "XF86AudioRaiseVolume" [] "amixer sset Master 5%+")
(genSpawnBinding "XF86AudioLowerVolume" [] "amixer sset Master 5%-")
(genSpawnBinding "XF86AudioMute" [] "amixer sset Master toggle")
(genSpawnBinding "XF86AudioNext" [] "playerctl next")
(genSpawnBinding "XF86AudioPrev" [] "playerctl previous")
(genSpawnBinding "XF86AudioPlay" [] "playerctl play-pause")
(genSpawnBinding "XF86AudioStop" [] "playerctl stop")
(
genSpawnBinding "XF86MonBrightnessUp" []
"busctl --user call com.system76.CosmicSettingsDaemon /com/system76/CosmicSettingsDaemon com.system76.CosmicSettingsDaemon IncreaseDisplayBrightness"
)
(
genSpawnBinding "XF86MonBrightnessDown" []
"busctl --user call com.system76.CosmicSettingsDaemon /com/system76/CosmicSettingsDaemon com.system76.CosmicSettingsDaemon DecreaseDisplayBrightness"
)
(genSpawnBinding "e" ["Super" "Shift"] "wlogout")
];
};
environment.cosmic.excludePackages = with pkgs; [
cosmic-store

View file

@ -6,7 +6,8 @@
fallbackDns = ["103.1.206.179" "168.138.8.38" "168.138.12.137"];
dnssec = "false";
};
services.mullvad-vpn.enable = true;
# services.mullvad-vpn.enable = true;
# systemd.services.mullvad-daemon.environment.TALPID_NET_CLS_MOUNT_DIR = "/opt/net-cls-v1";
networking.firewall = {
checkReversePath = "loose";
};

6
system/modules/niri.nix Normal file
View file

@ -0,0 +1,6 @@
{pkgs, ...}: {
programs.niri = {
enable = true;
package = pkgs.niri-unstable;
};
}

View file

@ -0,0 +1,21 @@
{
lib,
pkgs,
stable-diffusion,
automatic-webui,
...
}: {
systemd.services.stable-diffusion = {
description = "stable diffusion + AUTOMATIC1111 ui";
serviceConfig = {
};
};
# virtualisation.oci-containers.containers = {
# # this is only the backend
# stable-diffusion = {
# image = "holaflenain/stable-diffusion:latest";
# ports = ["7860:7860"];
# autoStart = false;
# };
# };
}

View file

@ -8,9 +8,16 @@
./configuration.nix
];
system.stateVersion = "22.11"; # Did you read the comment?
networking.hostName = "quiver";
users.users.bolt = {
isNormalUser = true;
extraGroups = ["wheel" "podman" "docker"]; # Enable sudo for the user.
extraGroups = [
"wheel"
"podman"
];
};
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbcore" "sd_mod"];
@ -29,7 +36,6 @@
"vt.global_cursor_default=0"
];
# boot.kernelPackages = pkgs.linuxPackages_cachyos;
boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
boot.supportedFilesystems = {
ntfs = true;
@ -39,42 +45,41 @@
boot.loader.systemd-boot.configurationLimit = 5;
boot.loader.efi.canTouchEfiVariables = true;
# boot.plymouth = with pkgs.rice.plymouth; {
# inherit font theme themePackages;
# enable = true;
# };
security.tpm2.enable = true;
networking.useDHCP = lib.mkDefault true;
hardware.cpu.amd.updateMicrocode = true;
environment.pathsToLink = ["/share/xdg-desktop-portal" "/share/applications"];
environment.sessionVariables = {
NIXOS_OZONE_WL = "1";
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=5";
GBM_BACKEND = "nvidia-drm";
NVD_BACKEND = "direct";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
LIBVA_DRIVER_NAME = "nvidia";
__GL_GSYNC_ALLOWED = "1";
__GL_VRR_ALLOWED = "1";
# GBM_BACKEND = "nvidia-drm";
# NVD_BACKEND = "direct";
# __GLX_VENDOR_LIBRARY_NAME = "nvidia";
# LIBVA_DRIVER_NAME = "nvidia";
# __GL_GSYNC_ALLOWED = "1";
# __GL_VRR_ALLOWED = "1";
EDITOR = "hx";
};
nix.settings.trusted-users = ["bolt"];
virtualisation.oci-containers.backend = "podman";
hardware.nvidia-container-toolkit.enable = true;
virtualisation = {
podman = {
enable = true;
# dockerSocket.enable = true;
# enableNvidia = true;
dockerSocket.enable = true;
defaultNetwork.settings.dns_enabled = true;
};
docker = {
enable = true;
enableNvidia = true;
enableOnBoot = true;
extraOptions = "--add-runtime nvidia=/run/current-system/sw/bin/nvidia-container-runtime";
};
# docker = {
# enable = true;
# enableOnBoot = true;
# enableNvidia = true;
# extraOptions = "--add-runtime nvidia=/run/current-system/sw/bin/nvidia-container-runtime";
# };
};
services.minidlna = {
@ -87,12 +92,13 @@
};
services.xserver.videoDrivers = ["nvidia"];
# TODO figure out why i can't resume properly
hardware.nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.stable;
package = config.boot.kernelPackages.nvidiaPackages.latest;
modesetting.enable = true;
powerManagement.enable = true;
# powerManagement.enable = true;
open = false;
nvidiaPersistenced = true;
# nvidiaPersistenced = true;
};
programs.xwayland.enable = true;
@ -118,22 +124,22 @@
xclip
];
networking.hostName = "quiver"; # Define your hostname.
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/b993b463-c131-4ef1-9aba-0e3eadaa2f9a";
fsType = "btrfs";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/b993b463-c131-4ef1-9aba-0e3eadaa2f9a";
fsType = "btrfs";
};
"/boot" = {
device = "/dev/disk/by-uuid/6B75-AF9F";
fsType = "vfat";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/6B75-AF9F";
fsType = "vfat";
};
fileSystems."/data" = {
device = "/dev/disk/by-uuid/39D4F78C658E8B56";
fsType = "ntfs";
options = ["rw" "uid=1000" "gid=100"];
"/data" = {
device = "/dev/disk/by-uuid/39D4F78C658E8B56";
fsType = "ntfs";
options = ["rw" "uid=1000" "gid=100"];
};
};
swapDevices = [