formatting and first module

This commit is contained in:
fleaz 2022-01-25 01:13:49 +01:00
parent 29e3201c57
commit e24d7c1790
5 changed files with 203 additions and 247 deletions

View file

@ -5,11 +5,11 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = imports = [
[
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
<home-manager/nixos> <home-manager/nixos>
../../modules/sound.nix
]; ];
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
@ -75,15 +75,6 @@
services.printing.enable = true; services.printing.enable = true;
# Enable sound.
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager). # Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true; # services.xserver.libinput.enable = true;
@ -112,12 +103,14 @@
wdisplays wdisplays
wofi wofi
firefox firefox
go
tig
nixfmt
discord discord
gnome.gnome-keyring gnome.gnome-keyring
via via
docker-compose docker-compose
swaylock swaylock
swayidle swayidle
wl-clipboard wl-clipboard
@ -130,7 +123,6 @@
htop htop
]; ];
programs.vim = { programs.vim = {
enable = true; enable = true;
plugins = with pkgs.vimPlugins; [ vim-airline neoformat vim-monokai ]; plugins = with pkgs.vimPlugins; [ vim-airline neoformat vim-monokai ];
@ -148,9 +140,7 @@
userEmail = "mail@felixbreidenstein.de"; userEmail = "mail@felixbreidenstein.de";
}; };
programs.waybar = { programs.waybar = { enable = true; };
enable = true;
};
programs.mako = { programs.mako = {
enable = true; enable = true;
@ -176,9 +166,7 @@
term = "xterm-256color"; term = "xterm-256color";
font = "FiraCode:size=14"; font = "FiraCode:size=14";
}; };
scrollback = { scrollback = { lines = 100000; };
lines = 100000;
};
colors = { colors = {
alpha = "0.98"; alpha = "0.98";
foreground = "B3B1AD"; foreground = "B3B1AD";
@ -203,17 +191,13 @@
}; };
}; };
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
config = { config = {
modifier = "Mod4"; modifier = "Mod4";
input = { input = {
"17498:8800:KBDFans_DZ60" = { "17498:8800:KBDFans_DZ60" = { xkb_layout = "eu"; };
xkb_layout = "eu";
};
#"1133:49295:Logitech_G403_HERO_Gaming_Mouse" = { #"1133:49295:Logitech_G403_HERO_Gaming_Mouse" = {
# pointer_accel = "1"; # pointer_accel = "1";
#}; #};
@ -237,26 +221,22 @@
}; };
}; };
gaps = { gaps = { inner = 8; };
inner = 8;
};
window.border = 0; window.border = 0;
workspaceAutoBackAndForth = true; workspaceAutoBackAndForth = true;
terminal = "foot"; terminal = "foot";
bars = [ { bars = [{ command = "${pkgs.waybar}/bin/waybar"; }];
command = "${pkgs.waybar}/bin/waybar";
}];
keybindings = let keybindings = let mod = "Mod4";
mod = "Mod4";
in { in {
"${mod}+Return" = "exec foot"; "${mod}+Return" = "exec foot";
"${mod}+p" = "exec ${pkgs.wofi}/bin/wofi --show drun"; "${mod}+p" = "exec ${pkgs.wofi}/bin/wofi --show drun";
"${mod}+Shift+c" = "reload"; "${mod}+Shift+c" = "reload";
"${mod}+Shift+q" = "kill"; "${mod}+Shift+q" = "kill";
"${mod}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; "${mod}+Shift+e" =
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
"${mod}+x" = "move workspace to output right"; "${mod}+x" = "move workspace to output right";
"${mod}+h" = "focus left"; "${mod}+h" = "focus left";
@ -300,26 +280,22 @@
"${mod}+Shift+9" = "move container to workspace 9"; "${mod}+Shift+9" = "move container to workspace 9";
"${mod}+Shift+0" = "move container to workspace 10"; "${mod}+Shift+0" = "move container to workspace 10";
# Multimedia Keys # Multimedia Keys
"XF86AudioMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"; "XF86AudioMute" =
"XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%"; "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%"; "XF86AudioRaiseVolume" =
"exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" =
"exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
}; };
}; };
}; };
}; };
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [ neovim wget curl git ];
neovim
wget
curl
git
];
programs.neovim.vimAlias = true; programs.neovim.vimAlias = true;

View file

@ -4,28 +4,27 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules =
[ "xhci_pci" "ehci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/1d2ce540-2fce-4621-8a4d-e05e09369bc3"; device = "/dev/disk/by-uuid/1d2ce540-2fce-4621-8a4d-e05e09369bc3";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/782C-3B0B"; device = "/dev/disk/by-uuid/782C-3B0B";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = swapDevices =
[ { device = "/dev/disk/by-uuid/6a0a9641-00c5-490e-abcc-9efeaeaca1f8"; } [{ device = "/dev/disk/by-uuid/6a0a9641-00c5-490e-abcc-9efeaeaca1f8"; }];
];
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

View file

@ -7,10 +7,8 @@
let let
home-manager = (import ./nix/sources.nix).home-manager; home-manager = (import ./nix/sources.nix).home-manager;
secretsFile = "/root.key"; secretsFile = "/root.key";
in in {
{ imports = [
imports =
[
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
"${home-manager}/nixos" "${home-manager}/nixos"
@ -38,7 +36,6 @@ in
# copy the secret into the additional initramfs. `null` means same path # copy the secret into the additional initramfs. `null` means same path
boot.initrd.secrets."${secretsFile}" = null; boot.initrd.secrets."${secretsFile}" = null;
networking.hostName = "jimbo"; # Define your hostname. networking.hostName = "jimbo"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
@ -49,7 +46,6 @@ in
networking.useDHCP = false; networking.useDHCP = false;
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;
driSupport = true; driSupport = true;
@ -90,12 +86,7 @@ in
}; };
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [ vim wget curl git ];
vim
wget
curl
git
];
services.openssh.enable = true; services.openssh.enable = true;
programs.ssh.startAgent = true; programs.ssh.startAgent = true;
@ -118,7 +109,6 @@ in
vscode vscode
vscode-extensions.vscodevim.vim vscode-extensions.vscodevim.vim
wdisplays wdisplays
albert albert
firefox firefox
@ -163,7 +153,6 @@ in
htop htop
]; ];
programs.neovim = { programs.neovim = {
enable = true; enable = true;
vimAlias = true; vimAlias = true;
@ -175,9 +164,7 @@ in
programs.zsh = { programs.zsh = {
enable = true; enable = true;
sessionVariables = { sessionVariables = { GOPATH = "/home/fleaz/workspace/go"; };
GOPATH = "/home/fleaz/workspace/go";
};
oh-my-zsh = { oh-my-zsh = {
enable = true; enable = true;
plugins = [ "git" "fzf" ]; plugins = [ "git" "fzf" ];
@ -192,9 +179,7 @@ in
userEmail = "mail@felixbreidenstein.de"; userEmail = "mail@felixbreidenstein.de";
}; };
programs.waybar = { programs.waybar = { enable = true; };
enable = true;
};
programs.mako = { programs.mako = {
enable = true; enable = true;
@ -225,7 +210,6 @@ in
}; };
}; };
services.blueman-applet.enable = true; services.blueman-applet.enable = true;
programs.foot = { programs.foot = {
@ -235,9 +219,7 @@ in
term = "xterm-256color"; term = "xterm-256color";
font = "FiraCode:size=14"; font = "FiraCode:size=14";
}; };
scrollback = { scrollback = { lines = 100000; };
lines = 100000;
};
colors = { colors = {
alpha = "0.98"; alpha = "0.98";
foreground = "B3B1AD"; foreground = "B3B1AD";
@ -262,8 +244,6 @@ in
}; };
}; };
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
@ -272,9 +252,7 @@ in
focus.followMouse = false; focus.followMouse = false;
input = { input = {
"17498:8800:KBDFans_DZ60" = { "17498:8800:KBDFans_DZ60" = { xkb_layout = "eu"; };
xkb_layout = "eu";
};
#"1133:49295:Logitech_G403_HERO_Gaming_Mouse" = { #"1133:49295:Logitech_G403_HERO_Gaming_Mouse" = {
# pointer_accel = "1"; # pointer_accel = "1";
#}; #};
@ -298,28 +276,22 @@ in
}; };
}; };
gaps = { gaps = { inner = 8; };
inner = 8;
};
window.border = 0; window.border = 0;
workspaceAutoBackAndForth = true; workspaceAutoBackAndForth = true;
terminal = "foot"; terminal = "foot";
bars = [{ bars = [{ command = "${pkgs.waybar}/bin/waybar"; }];
command = "${pkgs.waybar}/bin/waybar";
}];
keybindings = keybindings = let mod = "Mod4";
let in {
mod = "Mod4";
in
{
"${mod}+Return" = "exec foot"; "${mod}+Return" = "exec foot";
"${mod}+p" = "exec ${pkgs.wofi}/bin/wofi --show drun"; "${mod}+p" = "exec ${pkgs.wofi}/bin/wofi --show drun";
"${mod}+Shift+c" = "reload"; "${mod}+Shift+c" = "reload";
"${mod}+Shift+q" = "kill"; "${mod}+Shift+q" = "kill";
"${mod}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; "${mod}+Shift+e" =
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
"${mod}+x" = "move workspace to output right"; "${mod}+x" = "move workspace to output right";
"${mod}+h" = "focus left"; "${mod}+h" = "focus left";
@ -363,11 +335,13 @@ in
"${mod}+Shift+9" = "move container to workspace 9"; "${mod}+Shift+9" = "move container to workspace 9";
"${mod}+Shift+0" = "move container to workspace 10"; "${mod}+Shift+0" = "move container to workspace 10";
# Multimedia Keys # Multimedia Keys
"XF86AudioMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"; "XF86AudioMute" =
"XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%"; "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%"; "XF86AudioRaiseVolume" =
"exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" =
"exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
}; };
}; };

View file

@ -4,36 +4,33 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.availableKernelModules =
[ "xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{
device = "/dev/disk/by-uuid/5c29ff32-7186-4bfb-91ba-4bd14a72c7fa"; device = "/dev/disk/by-uuid/5c29ff32-7186-4bfb-91ba-4bd14a72c7fa";
fsType = "ext4"; fsType = "ext4";
}; };
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/55265801-0adc-4cde-9e88-a6c4a2a6c8c1"; boot.initrd.luks.devices."cryptroot".device =
"/dev/disk/by-uuid/55265801-0adc-4cde-9e88-a6c4a2a6c8c1";
fileSystems."/boot/efi" = fileSystems."/boot/efi" = {
{
device = "/dev/disk/by-uuid/A809-ABDC"; device = "/dev/disk/by-uuid/A809-ABDC";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = swapDevices = [{
[{
device = "/dev/disk/by-partuuid/706747af-4066-461f-8eac-06339c68f0db"; device = "/dev/disk/by-partuuid/706747af-4066-461f-8eac-06339c68f0db";
randomEncryption = true; randomEncryption = true;
}]; }];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

10
modules/sound.nix Normal file
View file

@ -0,0 +1,10 @@
{ ... }: {
# Enable sound.
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
}