Compare commits

...

41 commits

Author SHA1 Message Date
756547a1f6 Merge branch 'main' into cosmic 2024-05-31 18:22:24 +02:00
898b301fbc remove outdated plasma, sddm 2024-05-31 18:21:52 +02:00
2e58988fff docker: remove outdated comment 2024-05-31 18:20:52 +02:00
c41c2293f3 gnome: explicitly define packages to remove that are under gnome namespace 2024-05-31 18:20:11 +02:00
7202e30fa7 Merge branch 'main' into cosmic 2024-05-31 14:35:46 +02:00
ee64e04166 account: add zettlr package 2024-05-31 08:08:41 +02:00
8f15bf0e0c dconf: create generic module and use it
no more cringe function calling, yay
2024-05-29 04:48:25 +02:00
23bfb2d222 core: make wrapped nix commands higer priority 2024-05-28 22:55:22 +02:00
e66e4aaec0 core: remove duplicate package
already defined in shell.nix
2024-05-28 22:11:59 +02:00
98bba7fa6a core: wrap nix-build and nix-shell with default log format 2024-05-28 21:51:35 +02:00
5acbee3237 core: enable git module itself
oops
2024-05-28 12:22:59 +02:00
a6568d4891 core: create git configuration 2024-05-28 12:18:08 +02:00
af43682e8b shell: always show hostname 2024-05-28 12:12:51 +02:00
a91317ff35 accunt: use initialPassword field for initial password 2024-05-28 12:06:29 +02:00
2670ad97e8 hosts/tablet: add special power key events handling 2024-05-27 03:24:34 +02:00
4d4a007a00 hosts/main: store configuration previously in device-configuration.nix in git 2024-05-27 01:58:13 +02:00
da55e963be nix-os/udev: create 2024-05-27 01:56:50 +02:00
8db3b7cc1b vm: don't follow channel 2024-05-27 01:39:46 +02:00
384fdd9172 hosts: add tablet 2024-05-27 01:32:41 +02:00
1308bb8cc5 hosts/main: remove imports from etc
/etc/nixos/configuration.nix should import hosts configuration instead
2024-05-27 01:32:24 +02:00
8c352ea5ec shell/kitty: add shortcut for copying with ansi 2024-05-26 21:15:26 +02:00
99a10f35dd core: move bootloader to hosts 2024-05-22 15:41:40 +02:00
22a7d47ace core: split to core-desktop.nix 2024-05-22 15:41:40 +02:00
0dfba79fd3 shell: remove unused comment 2024-05-21 20:22:48 +02:00
6d793ecb1c core: move neovim to shell.nix 2024-05-21 20:22:26 +02:00
1786dbfac7 core: move programs.steam to account.nix 2024-05-21 20:07:30 +02:00
6a7dff6a96 core: remove firewall option definition 2024-05-21 16:09:40 +02:00
43ba0271aa core: move system.stateVersion to hosts 2024-05-21 15:15:01 +02:00
ab2c2b00fb core: move desktop apps to account.nix 2024-05-21 15:08:52 +02:00
1095c7884b core: disable flatpak 2024-05-21 15:03:32 +02:00
bd309d916c dconf-common: fix typos 2024-05-20 22:55:51 +02:00
31994d38f6 service/nix-binary-cache: create and use in main host 2024-05-19 13:27:41 +02:00
cae29c2484 meta: rename nix-os-configs to hosts 2024-05-17 21:45:11 +02:00
5d0bf2000d virtualization: explicitly enable ovmf with OVMFFull 2024-05-17 11:22:52 +02:00
1cc877bddb unstable-packages: store version in system derivation output 2024-05-14 06:57:27 +02:00
30bee709a5 Don't use store path for environment variables 2024-05-13 08:50:31 +02:00
b5885e7fa8 core: enable vimAlias 2024-05-12 03:39:48 +02:00
cab57d1dcc core: use direct envrioment.variables for setting nvim as default editor
programs.neovim.defaultEditor only sets "nvim" which is dependent on the PATH,
I don't want that
2024-05-12 03:39:08 +02:00
04767f4059 core: replace neofetch with fastfetch 2024-05-02 10:00:04 +02:00
2042ae5232 shell.nix: apply HISTCONTROL to bash interactiveShellInit 2024-04-20 03:28:18 +02:00
0d838e68aa dconf-common: set button layout and enable resizing with meta+rmb 2024-04-20 00:03:23 +02:00
23 changed files with 494 additions and 353 deletions

50
hosts/main.nix Normal file
View file

@ -0,0 +1,50 @@
{ pkgs, ... }:
{
imports = [
../nix-os/core.nix
../nix-os/core-desktop.nix
../nix-os/nvidia.nix
../nix-os/docker.nix
../nix-os/razer.nix
../nix-os/desktopManagers/gnome.nix
../nix-os/displayManagers/gdm.nix
#../nix-os/desktop/kde-plasma.nix
../nix-os/shell.nix
../nix-os/virtualization.nix
../nix-os/polkit/disable-shutdown.nix
../nix-os/locale.nix
../nix-os/adb.nix
../nix-os/account.nix
../nix-os/xdg-default-apps.nix
../nix-os/services/nix-binary-cache.nix
../nix-os/udev.nix
(builtins.fetchTarball "https://github.com/nix-community/nixos-vscode-server/tarball/fc900c16efc6a5ed972fb6be87df018bcf3035bc")
];
config = {
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "wroclaw-main";
services.xrdp.enable = true;
users.groups."tsusers".members = [ "wroclaw" ];
services.printing.drivers = with pkgs; [
hplip
];
# nixos-vscode-server module needs this
programs.nix-ld.enable = true;
services.vscode-server = {
enable = true;
extraRuntimeDependencies = with pkgs; [
docker
];
};
system.stateVersion = "23.05";
};
}

50
hosts/tablet.nix Normal file
View file

@ -0,0 +1,50 @@
{ config, lib, pkgs, ... }:
{
imports = [
../nix-os/core.nix
../nix-os/core-desktop.nix
../nix-os/account.nix
../nix-os/adb.nix
../nix-os/locale.nix
../nix-os/shell.nix
../nix-os/desktopManagers/gnome.nix
../nix-os/displayManagers/gdm.nix
../nix-os/udev.nix
];
config = {
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "wroclaw-hp";
networking.networkmanager.enable = true;
networking.firewall.enable = true;
services.xserver.displayManager.gdm.wayland = lib.mkForce true;
hardware.sensor.iio.enable = true;
networking.firewall.allowedTCPPortRanges = [
# KDE Connect
rec { from = 1714; to = from + 50; }
];
networking.firewall.allowedUDPPortRanges = [
# KDE Connect
rec { from = 1714; to = from + 50; }
];
services.logind.extraConfig = ''
HandlePowerKey=suspend
HandlePowerKeyLongPress=poweroff
HandleSuspendKey=suspend-then-hibernate
HandleSuspendKeyLongPress=hibernate
HandleLidSwitch=lock
HandleLidSwitchDocked=ignore
HandleLidSwitchExternalPower=lock
'';
system.stateVersion = "23.11";
};
}

View file

@ -3,6 +3,7 @@
{
imports = [
../nix-os/core.nix
../nix-os/core-desktop.nix
../nix-os/docker.nix
../nix-os/desktopManagers/cosmic.nix
../nix-os/displayManagers/cosmic-greeter.nix

View file

@ -14,5 +14,6 @@
../nix-os/adb.nix
../nix-os/account.nix
../nix-os/xdg-default-apps.nix
../nix-os/udev.nix
];
}

View file

@ -1,24 +0,0 @@
{ ... }:
{
imports = [
# Include the results of the hardware scan.
(if builtins.pathExists /etc/nixos/hardware-configuration.nix then /etc/nixos/hardware-configuration.nix else null)
# Include device-specific overrides
(if builtins.pathExists /etc/nixos/device-configuration.nix then /etc/nixos/device-configuration.nix else null)
../nix-os/core.nix
../nix-os/nvidia.nix
../nix-os/docker.nix
../nix-os/razer.nix
../nix-os/desktopManagers/gnome.nix
../nix-os/displayManagers/gdm.nix
#../nix-os/desktop/kde-plasma.nix
../nix-os/shell.nix
../nix-os/virtualization.nix
../nix-os/polkit/disable-shutdown.nix
../nix-os/locale.nix
../nix-os/adb.nix
../nix-os/account.nix
../nix-os/xdg-default-apps.nix
];
}

View file

@ -14,17 +14,25 @@
(if config.programs.adb.enable then "adbusers" else null)
];
linger = true;
# Initial password for the account
password = "nixos";
initialPassword = "nixos";
packages = with pkgs; [
firefox
vivaldi
discord-canary
unstablePkgs.vscode
gimp
inkscape
krita
unstablePkgs.zettlr
];
};
users.groups.wroclaw.gid = 1000;
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
};
services.syncthing = {
enable = true;
user = "wroclaw";

28
nix-os/core-desktop.nix Normal file
View file

@ -0,0 +1,28 @@
{config, lib, pkgs, ... }:
{
config = {
services.printing.enable = true;
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# Enable audio interfaces renaming
wireplumber.enable = true;
};
environment.systemPackages = with pkgs; [
mpv
];
services.openssh.extraConfig = ''
X11Forwarding yes
'';
};
}

View file

@ -2,43 +2,35 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running 'nixos-help').
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:
let
/*
* pkgs: package - nixpkgs package
* exe: string - executable (under bin) in pkgs
* wrapperArgs: string[] - arguments to pass to the wrapper
*/
mkWrappedExecutable = {pkg, exe ? pkg.meta.mainProgram, wrapperArgs}: let inherit (pkgs) lib makeWrapper; in pkgs.stdenv.mkDerivation {
name = "${pkg.name}-wrap-${exe}";
nativeBuildInputs = [ makeWrapper ];
phases = ["installPhase"];
installPhase = ''
mkdir -p $out/bin
makeWrapper ${pkg}/bin/${exe} $out/bin/${exe} ${lib.concatStringsSep " " wrapperArgs}
'';
};
wrapedNixPrograms = builtins.map lib.hiPrio [
(mkWrappedExecutable {pkg = pkgs.nix; exe = "nix-build"; wrapperArgs = ["--add-flags" "\"--log-format\"" "--add-flags" "bar-with-logs"];})
(mkWrappedExecutable {pkg = pkgs.nix; exe = "nix-shell"; wrapperArgs = ["--add-flags" "\"--log-format\"" "--add-flags" "bar"];})
];
in
{
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# kernel
boot.kernelPackages = pkgs.linuxPackages_latest;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Enable networking
networking.networkmanager.enable = true;
# X11 and desktop/display manager is enabled using imported files
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable flatpak, some software is newer here unfortunately
services.flatpak.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# Enable audio interfaces renaming
wireplumber.enable = true;
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
@ -46,55 +38,20 @@
# $ nix search wget
environment.systemPackages = with pkgs; [
wget
git
ffmpeg
yt-dlp
mpv
htop
btop
neofetch
ranger
gimp
inkscape
krita
fastfetch
smartmontools
ddrescue
];
] ++ wrapedNixPrograms;
# terminal text editor
programs.neovim = {
enable = true;
viAlias = true;
defaultEditor = true;
configure = {
customRC = ''
set number
set hlsearch
set incsearch
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set autoindent
syntax on
set encoding=utf-8
set wildmode=longest,list,full
set listchars=space:·,tab:»
set indentkeys-=0#
'';
packages.myVimPackage = with pkgs.vimPlugins; {
start = [
guess-indent-nvim
vim-visual-multi
];
};
};
};
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
programs.git.enable = true;
programs.git.config = {
init.defaultBranch = "main";
merge.conflictstyle = "diff3";
rerere.enabled = true;
};
# Enable fail2ban because of the OpenSSH server
@ -111,20 +68,5 @@
22
8022
];
extraConfig = ''
X11Forwarding yes
'';
};
# Disable firewall
networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
# I am lazy
}

View file

@ -1,158 +1,166 @@
# This file is not a NixOS system module
{config, lib, pkgs, ... }:
selection:
let
settings = with lib.gvariant; {
"org/gnome/desktop/background" = {
picture-options = "zoom";
picture-uri = "file://${../media/wallpaper.png}";
picture-uri-dark = "file://${../media/wallpaper.png}";
{
imports = [
./generic/dconf.nix
];
config = {
proot.dconf.rules = with lib.gvariant; {
"org/gnome/desktop/background" = {
picture-options = "zoom";
picture-uri = "file://${../media/wallpaper.png}";
picture-uri-dark = "file://${../media/wallpaper.png}";
};
"org/gnome/desktop/interface" = {
clock-show-date = true;
clock-show-seconds = true;
clock-show-weekday = true;
color-scheme = "prefer-dark";
cursor-theme = "GoogleDot-White";
};
"org/gnome/desktop/media-handling" = {
automount = false;
};
"org/gnome/desktop/peripherals/mouse" = {
accel-profile = "flat";
};
"org/gnome/desktop/sound" = {
allow-volume-above-100-percent = true;
};
"org/gnome/desktop/wm/preferences" = {
button-layout = "appmenu:close";
resize-with-right-button = true;
};
"org/gnome/mutter" = {
dynamic-workspaces = true;
workspaces-only-on-primary = true;
};
"org/gnome/SessionManager" = {
logout-prompt = false;
};
"org/gnome/settings-daemon/plugins/power" = {
power-button-action = "notning";
sleep-inactive-ac-type = "nothing";
};
"org/gnome/shell" = {
enabled-extensions = [
"drive-menu@gnome-shell-extensions.gcampax.github.com"
"pop-shell@system76.com"
"workspace-indicator@gnome-shell-extensions.gcampax.github.com"
"Vitals@CoreCoding.com"
"trayIconsReloaded@selfmade.pl"
"places-menu@gnome-shell-extensions.gcampax.github.com"
"apps-menu@gnome-shell-extensions.gcampax.github.com"
"top-bar-organizer@julian.gse.jsts.xyz"
"color-picker@tuberry"
];
favorite-apps = [
(if builtins.elem pkgs.kitty config.environment.systemPackages then
"kitty.desktop"
else none)
"vivaldi-stable.desktop"
"code.desktop"
"org.gnome.Nautilus.desktop"
(if config.programs.steam.enable then
"steam.desktop"
else none)
"pavucontrol.desktop"
];
};
"org/gnome/shell/app-switcher" = {
current-workspace-only = false;
};
"org/gnome/shell/extensions/color-picker" = {
color-picker-shortcut = ["<Super><Alt>c"];
enable-shortcut = true;
enable-systray = false;
menu-key = "";
notify-style = mkUint32 1;
preview-style = mkUint32 0;
};
"org/gnome/shell/extensions/pop-shell" = {
active-hint = true;
active-hint-border-radius = mkUint32 1;
gap-inner = mkUint32 2;
gap-outer = mkUint32 1;
show-skip-taskbar = true;
show-title = true;
smart-gaps = false;
snap-to-grid = false;
tile-by-default = true;
};
"org/gnome/shell/extensions/top-bar-organizer" = {
center-box-order = ["dateMenu"];
left-box-order = ["activities" "apps-menu" "places-menu" "vitalsMenu"];
right-box-order = ["TrayIconsReloaded" "workspace-indicator" "pop-shell" "color-picker@tuberry" "drive-menu" "screenRecording" "screenSharing" "dwellClick" "a11y" "keyboard" "quickSettings"];
};
"org/gnome/shell/extensions/trayIconsReloaded" = {
icon-brightness = mkInt32 0;
icon-contrast = mkInt32 0;
icon-margin-horizontal = mkInt32 0;
icon-margin-vertical = mkInt32 0;
icon-padding-horizontal = mkInt32 4;
icon-padding-vertical = mkInt32 0;
icon-saturation = mkInt32 0;
icon-size = mkInt32 16;
icons-limit = mkInt32 16;
invoke-to-workspace = true;
position-weight = mkInt32 0;
tray-margin-left = mkInt32 0;
tray-margin-right = mkInt32 0;
};
"org/gnome/shell/extensions/vitals" = {
hide-icons = false;
hot-sensors = ["_processor_usage_" "_memory_allocated_"];
memory-measurement = mkInt32 1;
update-time = mkInt32 2;
use-higher-precision = true;
};
"org/gnome/shell/keybindings" = {
show-screenshot-ui = ["Print" "<Super><Shift>S"];
};
"org/gnome/desktop/default-applications/terminal" =
if builtins.elem pkgs.kitty config.environment.systemPackages then {
exec = "kitty";
exec-arg = "";
} else null;
"org/gnome/settings-daemon/plugins/media-keys" = {
custom-keybindings = [
(
if builtins.elem pkgs.kitty config.environment.systemPackages then
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/"
else null
)
];
help = mkEmptyArray "s";
screensaver = ["<Control><Super>l"];
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" =
if builtins.elem pkgs.kitty config.environment.systemPackages then {
binding = "<Control><Alt>t";
command = "kitty";
name = "Terminal";
} else null;
};
"org/gnome/desktop/interface" = {
clock-show-date = true;
clock-show-seconds = true;
clock-show-weekday = true;
color-scheme = "prefer-dark";
cursor-theme = "GoogleDot-White";
};
"org/gnome/desktop/media-handling" = {
automount = false;
};
"org/gnome/desktop/peripherals/mouse" = {
accel-profile = "flat";
};
"org/gnome/desktop/sound" = {
allow-volume-above-100-percent = true;
};
"org/gnome/mutter" = {
dynamic-workspaces = true;
workspaces-only-on-primary = true;
};
"org/gnome/SessionManager" = {
logout-prompt = false;
};
"org/gnome/settings-daemon/plugins/power" = {
power-button-action = "notning";
sleep-inactive-ac-type = "nothing";
};
"org/gnome/shell" = {
enabled-extensions = [
"drive-menu@gnome-shell-extensions.gcampax.github.com"
"pop-shell@system76.com"
"workspace-indicator@gnome-shell-extensions.gcampax.github.com"
"Vitals@CoreCoding.com"
"trayIconsReloaded@selfmade.pl"
"places-menu@gnome-shell-extensions.gcampax.github.com"
"apps-menu@gnome-shell-extensions.gcampax.github.com"
"top-bar-organizer@julian.gse.jsts.xyz"
"color-picker@tuberry"
];
favorite-apps = [
(if builtins.elem pkgs.kitty config.environment.systemPackages then
"kitty.desktop"
else none)
"vivaldi-stable.desktop"
"code.desktop"
"org.gnome.Nautilus.desktop"
(if config.programs.steam.enable then
"steam.desktop"
else none)
"pavucontrol.desktop"
];
};
"org/gnome/shell/app-switcher" = {
current-workspace-only = false;
};
"org/gnome/shell/extensions/color-picker" = {
color-picker-shortcut = ["<Super><Alt>c"];
enable-shortcut = true;
enable-systray = false;
menu-key = "";
notify-style = mkUint32 1;
preview-style = mkUint32 0;
};
"org/gnome/shell/extensions/pop-shell" = {
active-hint = true;
active-hint-border-radius = mkUint32 1;
gap-inner = mkUint32 2;
gap-outer = mkUint32 1;
show-skip-taskbar = true;
show-title = true;
smart-gaps = false;
snap-to-grid = false;
tile-by-default = true;
};
"org/gnome/shell/extensions/top-bar-organizer" = {
center-box-order = ["dateMenu"];
left-box-order = ["activities" "apps-menu" "places-menu" "vitalsMenu"];
right-box-order = ["TrayIconsReloaded" "workspace-indicator" "pop-shell" "color-picker@tuberry" "drive-menu" "screenRecording" "screenSharing" "dwellClick" "a11y" "keyboard" "quickSettings"];
};
"org/gnome/shell/extensions/trayIconsReloaded" = {
icon-brightness = mkInt32 0;
icon-contrast = mkInt32 0;
icon-margin-horizontal = mkInt32 0;
icon-margin-vertical = mkInt32 0;
icon-padding-horizontal = mkInt32 4;
icon-padding-vertical = mkInt32 0;
icon-saturation = mkInt32 0;
icon-size = mkInt32 16;
icons-limit = mkInt32 16;
invoke-to-workspace = true;
position-weight = mkInt32 0;
tray-margin-left = mkInt32 0;
tray-margin-right = mkInt32 0;
};
"org/gnome/shell/extensions/vitals" = {
hide-icons = false;
hot-sensors = ["_processor_usage_" "_memory_allocated_"];
memory-measurement = mkInt32 1;
update-time = mkInt32 2;
use-higher-precision = true;
};
"org/gnome/shell/keybindings" = {
show-screenshot-ui = ["Print" "<Super><Shift>S"];
};
"org/gnome/desktop/default-applications/terminal" =
if builtins.elem pkgs.kitty config.environment.systemPackages then {
exec = "kitty";
exec-arg = "";
} else null;
"org/gnome/settings-daemon/plugins/media-keys" = {
custom-keybindings = [
(
if builtins.elem pkgs.kitty config.environment.systemPackages then
"org/gnome/settings-daemon/plugins/media-keys/custom-keybinding/custom0"
else null
)
];
help = mkEmptyArray "s";
screensaver = ["<Control><Super>l"];
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybinding/custom0" =
if builtins.elem pkgs.kitty config.environment.systemPackages then {
binding = "<Control><Alt>t";
command = "kitty";
name = "Terminal";
} else null;
};
in
lib.filterAttrs (n: v: builtins.elem n selection) settings
}

View file

@ -1,8 +1,9 @@
{pkgs, ... } @ moduleArgs:
{pkgs, ... }:
{
imports = [
../unstable-packages.nix
../dconf-common.nix
];
config = {
services.xserver.enable = true;
@ -10,49 +11,48 @@
# environment.sessionVariables.NIXOS_OZONE_WL = "1";
programs.dconf.profiles.user.databases = [{
settings = import ../dconf-common.nix moduleArgs [
"org/gnome/desktop/background"
"org/gnome/desktop/interface"
"org/gnome/desktop/media-handling"
"org/gnome/desktop/peripherals/mouse"
"org/gnome/desktop/sound"
"org/gnome/mutter"
"org/gnome/SessionManager"
"org/gnome/settings-daemon/plugins/power"
"org/gnome/shell"
"org/gnome/shell/app-switcher"
"org/gnome/shell/extensions/color-picker"
"org/gnome/shell/extensions/pop-shell"
"org/gnome/shell/extensions/top-bar-organizer"
"org/gnome/shell/extensions/trayIconsReloaded"
"org/gnome/shell/extensions/vitals"
"org/gnome/shell/keybindings"
"org/gnome/desktop/default-applications/terminal"
"org/gnome/settings-daemon/plugins/media-keys"
"org/gnome/settings-daemon/plugins/media-keys/custom-keybinding/custom0"
];
}];
proot.dconf.profiles.user.rulesToApply = [
"org/gnome/desktop/background"
"org/gnome/desktop/interface"
"org/gnome/desktop/media-handling"
"org/gnome/desktop/peripherals/mouse"
"org/gnome/desktop/sound"
"org/gnome/desktop/wm/preferences"
"org/gnome/mutter"
"org/gnome/SessionManager"
"org/gnome/settings-daemon/plugins/power"
"org/gnome/shell"
"org/gnome/shell/app-switcher"
"org/gnome/shell/extensions/color-picker"
"org/gnome/shell/extensions/pop-shell"
"org/gnome/shell/extensions/top-bar-organizer"
"org/gnome/shell/extensions/trayIconsReloaded"
"org/gnome/shell/extensions/vitals"
"org/gnome/shell/keybindings"
"org/gnome/desktop/default-applications/terminal"
"org/gnome/settings-daemon/plugins/media-keys"
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0"
];
environment.gnome.excludePackages = with pkgs; with pkgs.gnome; [
baobab
cheese
epiphany
evince
geary
environment.gnome.excludePackages = with pkgs; [
gnome.baobab
gnome.cheese
gnome.epiphany
gnome.evince
gnome.geary
gedit
gnome-characters
gnome.gnome-characters
gnome-connections
gnome-console
gnome-disk-utility
gnome-font-viewer
gnome-logs
gnome-maps
gnome.gnome-disk-utility
gnome.gnome-font-viewer
gnome.gnome-logs
gnome.gnome-maps
gnome-text-editor
gnome-tour
seahorse
totem
yelp
gnome.seahorse
gnome.totem
gnome.yelp
];
environment.systemPackages = with pkgs; [

View file

@ -1,16 +0,0 @@
{lib, config, pkgs, ...}:
{
config = {
services.xserver.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
# environment.sessionVariables.NIXOS_OZONE_WL = "1";
environment.systemPackages = with pkgs; [
libsForQt5.plasma-browser-integration
translate-shell
pavucontrol
];
};
}

View file

@ -1,6 +1,9 @@
{pkgs, ... } @ moduleArgs:
{pkgs, ... }:
{
imports = [
../dconf-common.nix
];
config = {
services.xserver.displayManager.gdm = {
enable = true;
@ -8,15 +11,13 @@
autoSuspend = false;
};
programs.dconf.profiles.gdm.databases = [{
settings = import ../dconf-common.nix moduleArgs [
"org/gnome/desktop/interface"
"org/gnome/desktop/peripherals/mouse"
"org/gnome/desktop/sound"
"org/gnome/settings-daemon/plugins/power"
"org/gnome/shell/keybindings"
];
}];
proot.dconf.profiles.gdm.rulesToApply = [
"org/gnome/desktop/interface"
"org/gnome/desktop/peripherals/mouse"
"org/gnome/desktop/sound"
"org/gnome/settings-daemon/plugins/power"
"org/gnome/shell/keybindings"
];
environment.systemPackages = with pkgs; [
google-cursor

View file

@ -1,7 +0,0 @@
{ ... }:
{
config = {
services.xserver.displayManager.sddm.enable = true;
};
}

View file

@ -3,7 +3,6 @@
{
config.virtualisation.docker = {
enable = true;
# enableNvidia = true;
enableOnBoot = true;
storageDriver = if config.fileSystems."/".fsType == "btrfs" then "btrfs" else null;
rootless.enable = true;

46
nix-os/generic/dconf.nix Normal file
View file

@ -0,0 +1,46 @@
{ config, lib, pkgs, options, ... }:
# proot.dconf.rules
# proot.dconf.profiles.<profile>.rulesToApply
# proot.dconf.profiles.<profile>.extraRules
let
cfg = config.proot.dconf;
profileOpts = lib.types.submodule {
options = {
rulesToApply = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = lib.attrNames cfg.rules;
description = lib.mdDoc "A list of rules keys to apply for profile";
};
extraRules = lib.mkOption {
type = lib.types.attrs;
default = {};
description = lib.mdDoc "An attrset of additional dconf rules to apply ontop of selected";
};
};
};
mapper = _: value: {
databases = lib.singleton {
settings = lib.filterAttrs (key: _: lib.elem key value.rulesToApply) cfg.rules // value.extraRules;
};
};
in
{
options.proot.dconf = {
rules = lib.mkOption {
type = lib.types.attrs;
default = {};
description = lib.mdDoc "An attrset of dconf rules to pull from";
};
profiles = lib.mkOption {
type = lib.types.attrsOf profileOpts;
default = {};
description = lib.mdDoc "An attret of profiles to create, with pulled rules";
};
};
config = {
programs.dconf.profiles = lib.mapAttrs mapper cfg.profiles;
};
}

View file

@ -0,0 +1,8 @@
{
config = {
services.nix-serve = {
enable = true;
secretKeyFile = "/var/cache-priv-key.pem";
};
};
}

View file

@ -1,4 +1,4 @@
{ config, pkgs, unstablePkgs, ... }:
{ config, pkgs, unstablePkgs, lib, ... }:
let
rangerGit = pkgs.ranger.overrideAttrs (old: {
@ -37,6 +37,7 @@ in
'';
programs.bash.interactiveShellInit = ''
HISTCONTROL=ignoreboth
if test -n "$KITTY_INSTALLATION_DIR"; then
export KITTY_SHELL_INTEGRATION="enabled,no-sudo"
source "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"
@ -53,6 +54,8 @@ in
${if config.services.xserver.desktopManager.gnome.enable then "hide_window_decorations yes" else ""}
background_opacity 0.8
dynamic_background_opacity yes
map kitty_mod+alt+c copy_ansi_to_clipboard
'';
environment.etc."ranger/rc.conf".text = ''
@ -74,6 +77,41 @@ in
programs.direnv.enable = true;
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
configure = {
customRC = ''
set number
set hlsearch
set incsearch
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set autoindent
syntax on
set encoding=utf-8
set wildmode=longest,list,full
set listchars=space:·,tab:»
set indentkeys-=0#
'';
packages.myVimPackage = with pkgs.vimPlugins; {
start = [
guess-indent-nvim
vim-visual-multi
];
};
};
};
environment.variables = lib.mkIf config.programs.neovim.enable rec {
EDITOR = "/run/current-system/sw/bin/nvim";
VISUAL = EDITOR;
};
programs.starship = {
enable = true;
settings = {
@ -82,6 +120,9 @@ in
truncation_length = 5;
truncation_symbol = "/";
};
hostname = {
ssh_only = false;
};
username = {
show_always = true;
};
@ -91,12 +132,6 @@ in
command = "echo \"\"";
style = "bold 208";
};
# custom.PS1 = {
# when = true;
# command = "echo -e \"\\x1b\\x5d133;A\\x1b\\x5c\"";
# format = "$output";
# use_stdin = false;
# };
};
};
}

5
nix-os/udev.nix Normal file
View file

@ -0,0 +1,5 @@
{
config = {
hardware.ledger.enable = true;
};
}

View file

@ -31,6 +31,7 @@ in
};
};
config._module.args.unstablePkgs = config.unstable.pkgs;
# FIXME: move it to the system derivation output (overrideAttrs config.system.build.toplevel?)
config.environment.etc."NIXOS-UNSTABLE-VERSION".text = nixos-unstable-version;
config.system.extraSystemBuilderCmds = lib.mkIf config.unstable.enable ''
echo ${nixos-unstable-version} > $out/nixos-unstable-version
'';
}

View file

@ -6,5 +6,11 @@
programs.virt-manager.enable = true;
virtualisation.libvirtd = {
enable = true;
qemu.ovmf = {
enable = true;
packages = [
pkgs.OVMFFull.fd
];
};
};
}

View file

@ -1 +0,0 @@
NIXOS_CONFIG="$(pwd)/nix-os-configs/main.nix" nixos-rebuild $@

View file

@ -1 +1 @@
nix-build '<nixos-unstable/nixos>' -A vm -I nixpkgs=channel:nixos-unstable -I nixos-config=./nix-os-configs/vm-cosmic.nix $@ && $(ls ./result/bin/run-*) -m 4096 && rm *.qcow2
nix-build '<nixos-unstable/nixos>' -A vm -I nixos-config=./hosts/vm-cosmic.nix $@ && $(ls ./result/bin/run-*) -m 4096 && rm *.qcow2

2
vm.sh
View file

@ -1 +1 @@
nix-build '<nixpkgs/nixos>' -A vm -I nixpkgs=channel:nixos-23.11 -I nixos-config=./nix-os-configs/vm.nix $@ && $(ls ./result/bin/run-*) -m 4096 && rm *.qcow2
nix-build '<nixpkgs/nixos>' -A vm -I nixos-config=./hosts/vm.nix $@ && $(ls ./result/bin/run-*) -m 4096 && rm *.qcow2