aaaaaaaaaaaaaaaaaaaaaaaaa

This commit is contained in:
Gabriel 2022-08-12 12:14:32 +02:00
parent a4cd48ad93
commit 55b1c49913
6 changed files with 215 additions and 67 deletions

View file

@ -2,10 +2,13 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
let smol = import <nixos-unstable-small> {config.allowUnfree = true;}; # let smol = import <nixos-unstable-small> {config.allowUnfree = true;};
in { with lib;
with builtins;
{
imports = [ ./modules ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nix = { nix = {
@ -17,8 +20,6 @@ in {
''; '';
}; };
imports = [
];
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
@ -26,31 +27,36 @@ in {
networking.networkmanager.wifi.backend = "iwd"; networking.networkmanager.wifi.backend = "iwd";
networking.extraHosts = "100.122.76.64 listenwithme.tailnet.ckie.dev"; networking.extraHosts = "100.122.76.64 listenwithme.tailnet.ckie.dev";
services.xserver = { home-manager.users.jade = { nixosConfig, pkgs, ... }: {
enable = true; home.sessionVariables.TZ = nixosConfig.time.timeZone;
desktopManager = {
xterm.enable = false;
}; };
displayManager = { #services.xserver = {
defaultSession = "none+i3"; #enable = true;
gdm.enable = true;
};
windowManager.i3 = { #desktopManager = {
enable = true; #xterm.enable = false;
package = pkgs.i3-gaps; #};
extraPackages = with pkgs; [
gnome.gdm i3lock-fancy rofi rofimoji volumeicon feh xorg.xinput dunst #displayManager = {
arandr lxappearance gruvbox-dark-gtk gruvbox-dark-icons-gtk #defaultSession = "none+i3";
gruvterial-theme flameshot tesseract5 imagemagick xclip polybar kitty #gdm.enable = true;
xkeysnail gtk-engine-murrine playerctl xmacro #};
];
}; #windowManager.i3 = {
}; #enable = true;
#package = pkgs.i3-gaps;
#extraPackages = with pkgs; [
## gnome.gdm i3lock-fancy rofi rofimoji volumeicon feh xorg.xinput dunst
## arandr lxappearance gruvbox-dark-gtk gruvbox-dark-icons-gtk
## gruvterial-theme flameshot tesseract5 imagemagick xclip polybar kitty
## xkeysnail gtk-engine-murrine playerctl xmacro
#];
#};
#};
programs.dconf.enable = true; programs.dconf.enable = true;
programs.qt5ct.enable = true;
qt5.platformTheme = "qt5ct";
virtualisation.libvirtd.enable = true; virtualisation.libvirtd.enable = true;
@ -61,7 +67,7 @@ in {
hardware.uinput.enable = true; hardware.uinput.enable = true;
services.printing.enable = true; services.printing.enable = true;
services.tailscale.enable = true; # services.tailscale.enable = true;
security.rtkit.enable = true; security.rtkit.enable = true;
services.pipewire = { services.pipewire = {
@ -94,11 +100,11 @@ in {
librewolf polymc jdk8 jdk11 jdk vlc xfce.thunar xfce.tumbler librewolf polymc jdk8 jdk11 jdk vlc xfce.thunar xfce.tumbler
xfce.thunar-archive-plugin gnome.file-roller uhk-agent spotify spotify-tray xfce.thunar-archive-plugin gnome.file-roller uhk-agent spotify spotify-tray
spotify-tui cool-retro-term lutris libsecret gh xorg.xhost helvum spotify-tui cool-retro-term lutris libsecret gh xorg.xhost helvum
xdg-desktop-portal-gtk nheko smol.discord obsidian jetbrains.clion xdg-desktop-portal-gtk nheko obsidian jetbrains.clion
jetbrains.webstorm jetbrains.datagrip jetbrains.idea-ultimate jetbrains.webstorm jetbrains.datagrip jetbrains.idea-ultimate
jetbrains.pycharm-professional nix-prefetch-scripts audacity rustup jetbrains.pycharm-professional nix-prefetch-scripts audacity rustup
easyeffects virt-manager manim evince direnv nix-direnv python3Full easyeffects virt-manager evince direnv nix-direnv python3Full
python39Packages.pip python39Packages.setuptools python39Packages.ipykernel # python39Packages.pip python39Packages.setuptools python39Packages.ipykernel
fzf openrgb krita gimp inkscape blender virglrenderer ddccontrol-db fzf openrgb krita gimp inkscape blender virglrenderer ddccontrol-db
glab firebird-emu glab firebird-emu
]; ];
@ -125,7 +131,6 @@ in {
users.defaultUserShell = pkgs.zsh; users.defaultUserShell = pkgs.zsh;
services.openssh.enable = true; services.openssh.enable = true;
services.blueman.enable = true;
services.gnome.gnome-keyring.enable = true; services.gnome.gnome-keyring.enable = true;
programs.seahorse.enable = true; programs.seahorse.enable = true;

View file

@ -1,6 +1,4 @@
{ ... }: { ... }:
{ {
imports = [ imports = [ ./desktop.nix ];
];
} }

87
modules/desktop.nix Normal file
View file

@ -0,0 +1,87 @@
{ config, lib, pkgs, ... }:
let
cfg = config.jade.desktop;
window-screenshot = pkgs.writeShellScriptBin "window-screenshot.sh" ''
unset x y w h
eval $(xwininfo -id $(xdotool getactivewindow) |
sed -n -e "s/^ \+Absolute upper-left X: \+\([0-9]\+\).*/x=\1/p" \
-e "s/^ \+Absolute upper-left Y: \+\([0-9]\+\).*/y=\1/p" \
-e "s/^ \+Width: \+\([0-9]\+\).*/w=\1/p" \
-e "s/^ \+Height: \+\([0-9]\+\).*/h=\1/p" )
echo -n "''$x ''$y ''$w ''$h"
flameshot gui --region "''${w}x''${h}+''${x}+''${y}" -c -p ~/Pictures/screenshots/
'';
in with lib; {
options.jade.desktop = {
enable = mkEnableOption "Enable the i3 setup";
};
config = mkIf cfg.enable {
home-manager.users.jade = { pkgs, ... }: {
home.packages = with pkgs; [
gnome.gdm i3lock-fancy rofi rofimoji volumeicon feh xorg.xinput dunst
arandr lxappearance gruvbox-dark-gtk gruvbox-dark-icons-gtk
gruvterial-theme flameshot tesseract5 imagemagick xclip polybar kitty
xkeysnail gtk-engine-murrine playerctl xmacro
window-screenshot
];
xsession = {
enable = true;
windowManager.i3 = {
enable = true;
package = pkgs.i3-gaps;
config = {
terminal = "kitty";
modifier = "Mod4";
gaps = {
inner = 15;
outer = 0;
smartGaps = true;
};
modes = {
resize = with {
aaa = builtins.trace "foo" "bar";
mod = builtins.trace config config.xsession.windowManager.i3.config.modifier;
}; {
"${mod}+h" = "resize shrink width 10 px or 10 ppt";
"${mod}+j" = "resize grow height 10 px or 10 ppt";
"${mod}+k" = "resize shrink height 10 px or 10 ppt";
"${mod}+l" = "resize grow width 10 px or 10 ppt";
"Return" = "mode default";
"Escape" = "mode default";
"${mod}+r" = "mode default";
};
};
keybindings = with {
mod = config.xsession.windowManager.i3.config.modifier;
}; {
# switch window focus
"${mod}+h" = "focus left";
"${mod}+j" = "focus down";
"${mod}+k" = "focus up";
"${mod}+l" = "focus right";
# move windows
"${mod}+Shift+h" = "move left";
"${mod}+Shift+j" = "move down";
"${mod}+Shift+k" = "move up";
"${mod}+Shift+l" = "move right";
# layout shit
"${mod}+shift+semicolon" = "split h";
"${mod}+semicolon" = "split v";
"${mod}+f" = "fullscreen toggle";
"${mod}+Shift+w" = "layout tabbed";
"${mod}+e" = "layout toggle split";
"${mod}+Shift+space" = "floating toggle";
# focus parents/children
"${mod}+Shift+a" = "focus parent";
"${mod}+c" = "focus child";
# custom script shit
"${mod}+w" = "exec window-screenshot.sh";
};
};
};
};
};
};
}

View file

@ -3,13 +3,16 @@
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
../common.nix ../common.nix
]; ];
jade = {
desktop.enable = true;
};
# monitor control # monitor control
services.ddccontrol.enable = true; services.ddccontrol.enable = true;
@ -27,14 +30,6 @@
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
hardware.keyboard.uhk.enable = true; hardware.keyboard.uhk.enable = true;
users.users.jade = {
isNormalUser = true;
extraGroups = [ "wheel" "input" "uinput" "libvirtd" ];
packages = with pkgs; [
];
};
# missing: menu-qalc picom-jonaburg # missing: menu-qalc picom-jonaburg
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# TODO: clean up. # TODO: clean up.
@ -44,24 +39,6 @@
"/share/nix-direnv" "/share/nix-direnv"
]; ];
services.flatpak.enable = true;
xdg.portal.enable = true;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
fonts.fonts = with pkgs; [
nerdfonts montserrat noto-fonts
];
programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
services.openssh.enable = true;
services.blueman.enable = true; services.blueman.enable = true;
services.gnome.gnome-keyring.enable = true; services.gnome.gnome-keyring.enable = true;

View file

@ -0,0 +1,78 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
},
"locked": {
"lastModified": 1659878744,
"narHash": "sha256-81a9Mx5pDMBGN4WnVhcQVkW5mXNTZOt8DZOSI8bVKpU=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f5e9879e74e6202e2dbb3628fad2d20eac0d8be4",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1654953433,
"narHash": "sha256-TwEeh4r50NdWHFAHQSyjCk2cZxgwUfcCCAJOhPdXB28=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "90cd5459a1fd707819b9a3fb9c852beaaac3b79a",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1659327012,
"narHash": "sha256-zpdsLCH+cdx/K89QtzADNwwEzU/iJ9YT8UCVp3veLWQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a54fb7fc4ce8a2973097851eabfdb068a19d2211",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable-small",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs_2"
}
},
"utils": {
"locked": {
"lastModified": 1653893745,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View file

@ -6,10 +6,10 @@
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpks.follows = "nixpkgs"; inputs.nixpks.follows = "nixpkgs";
} };
}; };
outputs = { self, nixpkgs, home-manager }: { outputs = { self, nixpkgs, home-manager, ... }: {
nixosConfigurations = { nixosConfigurations = {
monosodium-glutamate-g = nixpkgs.lib.nixosSystem { monosodium-glutamate-g = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
@ -19,7 +19,10 @@
home-manager.nixosModules.home-manager { home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.jade = import ./home.nix; home-manager.users.jade = { nixosConfig, pkgs, ... }: {
home.sessionVariables.TZ = nixosConfig.time.timeZone;
home.stateVersion = "${nixosConfig.system.stateVersion}";
};
} }
]; ];
}; };