This commit is contained in:
Leonardo Eugênio 2022-07-21 00:32:09 -03:00
parent ed6f853da0
commit 810cf18e20
5 changed files with 306 additions and 338 deletions

View file

@ -5,7 +5,7 @@
nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/release-22.05"; home-manager.url = "github:nix-community/home-manager/release-22.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
nur.url = github:nix-community/NUR; nur.url = "github:nix-community/NUR";
}; };
outputs = { nixpkgs, nixpkgs-unstable, home-manager, nur, ... }: outputs = { nixpkgs, nixpkgs-unstable, home-manager, nur, ... }:
let let
@ -26,7 +26,9 @@
common_modules = [ common_modules = [
./system/configuration.nix ./system/configuration.nix
# nur.nixosModules.nur # nur.nixosModules.nur
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable nur.overlay ]; }) ({ config, pkgs, ... }: {
nixpkgs.overlays = [ overlay-unstable nur.overlay ];
})
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
@ -41,15 +43,13 @@
nixosConfigurations = { nixosConfigurations = {
i15 = lib.nixosSystem { i15 = lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [ ./system/i15-hardware-configuration.nix ]
./system/i15-hardware-configuration.nix ++ common_modules;
] ++ common_modules;
}; };
monolith = lib.nixosSystem { monolith = lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [ ./system/monolith-hardware-configuration.nix ]
./system/monolith-hardware-configuration.nix ++ common_modules;
] ++ common_modules;
}; };
}; };
}; };

View file

@ -38,8 +38,7 @@ let
gsettings set $gnome_schema gtk-theme 'Dracula' gsettings set $gnome_schema gtk-theme 'Dracula'
''; '';
}; };
in in {
{
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;

View file

@ -1,26 +1,23 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }: {
{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
imports = boot.initrd.availableKernelModules =
[ (modulesPath + "/installer/scan/not-detected.nix") [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_usb_sdmmc" ];
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_usb_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/67af2da1-b4a8-4c32-a7e8-c1d0a8de21ab"; device = "/dev/disk/by-uuid/67af2da1-b4a8-4c32-a7e8-c1d0a8de21ab";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot/efi" = fileSystems."/boot/efi" = {
{ device = "/dev/disk/by-uuid/1428-8899"; device = "/dev/disk/by-uuid/1428-8899";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = swapDevices =
[ { device = "/dev/disk/by-uuid/4d214f1e-63d5-4a1b-94fe-50af27824325"; } [{ device = "/dev/disk/by-uuid/4d214f1e-63d5-4a1b-94fe-50af27824325"; }];
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction # still possible to use this option, but it's recommended to use it in conjunction
@ -29,6 +26,7 @@
# networking.interfaces.enp2s0.useDHCP = lib.mkDefault true; # networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault 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;
networking.hostName = "i15"; # Define your hostname. networking.hostName = "i15"; # Define your hostname.
} }

View file

@ -1,17 +1,15 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }: {
{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
imports = boot.initrd.availableKernelModules =
[ (modulesPath + "/installer/scan/not-detected.nix") [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-label/BTRFS_ROOT"; device = "/dev/disk/by-label/BTRFS_ROOT";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=nixos" ]; options = [ "subvol=nixos" ];
}; };
@ -20,22 +18,22 @@
"main".device = "/dev/disk/by-label/CRYPT_ROOT"; "main".device = "/dev/disk/by-label/CRYPT_ROOT";
"data".device = "/dev/disk/by-label/CRYPT_DATA"; "data".device = "/dev/disk/by-label/CRYPT_DATA";
}; };
fileSystems."/boot/efi" = fileSystems."/boot/efi" = {
{ device = "/dev/disk/by-label/NIXBOOT"; device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/home" = fileSystems."/home" = {
{ device = "/dev/disk/by-label/BTRFS_ROOT"; device = "/dev/disk/by-label/BTRFS_ROOT";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=home" ]; options = [ "subvol=home" ];
}; };
fileSystems."/home/lelgenio/Games" = fileSystems."/home/lelgenio/Games" = {
{ device = "/dev/disk/by-label/BTRFS_DATA"; device = "/dev/disk/by-label/BTRFS_DATA";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@games" "nofail" ]; options = [ "subvol=@games" "nofail" ];
}; };
fileSystems."/home/lelgenio/Downloads/Torrents" = fileSystems."/home/lelgenio/Downloads/Torrents" = {
{ device = "/dev/disk/by-label/BTRFS_DATA"; device = "/dev/disk/by-label/BTRFS_DATA";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@torrents" "nofail" ]; options = [ "subvol=@torrents" "nofail" ];
}; };
@ -49,6 +47,7 @@
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
networking.hostName = "monolith"; # Define your hostname. networking.hostName = "monolith"; # Define your hostname.
} }

View file

@ -1,4 +1,5 @@
{ config, pkgs, lib, ... }: let { config, pkgs, lib, ... }:
let
key = { key = {
left = "n"; left = "n";
down = "e"; down = "e";
@ -51,8 +52,10 @@
}; };
}; };
papirus_red = (pkgs.unstable.papirus-icon-theme.override { color = "red"; }); papirus_red = (pkgs.unstable.papirus-icon-theme.override { color = "red"; });
orchis_theme_compact = (pkgs.orchis-theme.override { tweaks = [ "compact" "solid" ]; }); orchis_theme_compact =
nerdfonts_fira_hack = (pkgs.nerdfonts.override { fonts = [ "FiraCode" "Hack" ]; }); (pkgs.orchis-theme.override { tweaks = [ "compact" "solid" ]; });
nerdfonts_fira_hack =
(pkgs.nerdfonts.override { fonts = [ "FiraCode" "Hack" ]; });
accent = accents.red; accent = accents.red;
color = themes.dark.color; color = themes.dark.color;
pulse_sink = pkgs.writeShellScriptBin "pulse_sink" '' pulse_sink = pkgs.writeShellScriptBin "pulse_sink" ''
@ -181,14 +184,10 @@ in {
g.n = "goto_line_start"; g.n = "goto_line_start";
g.o = "goto_line_end"; g.o = "goto_line_end";
}; };
keys.insert = { keys.insert = { "A-k" = "normal_mode"; };
"A-k" = "normal_mode";
}; };
}; };
}; home.sessionVariables = { EDITOR = "hx"; };
home.sessionVariables = {
EDITOR = "hx";
};
programs.firefox = { programs.firefox = {
enable = true; enable = true;
package = pkgs.firefox; package = pkgs.firefox;
@ -223,51 +222,43 @@ in {
systemd.target = "sway-session.target"; systemd.target = "sway-session.target";
settings = [{ settings = [{
layer = "top"; layer = "top";
modules-left = [ modules-left = [ "sway/workspaces" "sway/mode" ];
"sway/workspaces" modules-center = [ "clock" ];
"sway/mode" modules-right = [ "pulseaudio" "network" ];
]; network = {
modules-center = [ interval = 5;
"clock" tooltip = false;
]; on-click = "terminal iwd";
modules-right = [ format-wifi = "{icon}";
"pulseaudio" format-icons = [ "" "" "" "" "" ];
"network" format-ethernet = "";
]; format-linked = "";
"network" = { format-disconnected = "";
"interval"= 5;
"tooltip" = false;
"on-click" = "terminal iwd";
"format-wifi" = "{icon}";
"format-icons" = [ "" "" "" "" "" ];
"format-ethernet" = "";
"format-linked" = "";
"format-disconnected" = "";
}; };
"clock" = { clock = {
"interval"=60; interval = 60;
"format"="<b>{:%H:%M %a %d/%m}</b>"; format = "<b>{:%H:%M %a %d/%m}</b>";
"tooltip"=false; tooltip = false;
}; };
"pulseaudio"= { pulseaudio = {
"interval"= 5; interval = 5;
"tooltip"=false; tooltip = false;
"scroll-step"= 10; scroll-step = 10;
"format"= "{icon}"; format = "{icon}";
"format-bluetooth"= ""; format-bluetooth = "";
"format-bluetooth-muted"= ""; format-bluetooth-muted = "";
"format-muted"= ""; format-muted = "";
"format-icons"= { format-icons = {
"headphone"= [" " " 奔" " "]; headphone = [ " " " 奔" " " ];
"handsfree"= ""; handsfree = "";
"headset"= ""; headset = "";
"phone"= ""; phone = "";
"portable"= ""; portable = "";
"car"= ""; car = "";
"default"= ["" "奔" ""]; default = [ "" "奔" "" ];
}; };
"on-click"= "pavucontrol"; on-click = "pavucontrol";
"on-click-right"= "pulse-sink"; on-click-right = "pulse-sink";
}; };
}]; }];
style = '' style = ''
@ -395,8 +386,7 @@ in {
smartBorders = "on"; smartBorders = "on";
inner = 5; inner = 5;
}; };
colors = colors = let
let
acc = accent.color; acc = accent.color;
fg_acc = accent.fg; fg_acc = accent.fg;
fg_color = color.txt; fg_color = color.txt;
@ -405,8 +395,7 @@ in {
client = border: background: text: indicator: childBorder: { client = border: background: text: indicator: childBorder: {
inherit border background text indicator childBorder; inherit border background text indicator childBorder;
}; };
in in {
{
focused = client acc acc fg_acc acc acc; focused = client acc acc fg_acc acc acc;
focusedInactive = client bg_color bg_color fg_color bg_color bg_color; focusedInactive = client bg_color bg_color fg_color bg_color bg_color;
unfocused = client bg_color bg_color fg_color bg_color bg_color; unfocused = client bg_color bg_color fg_color bg_color bg_color;
@ -434,16 +423,14 @@ in {
{ title = "Discord"; } { title = "Discord"; }
]; ];
}; };
modes = let modes = let return_mode = lib.mapAttrs (k: v: "${v}; mode default");
return_mode = lib.mapAttrs (k: v: "${v}; mode default");
in { in {
audio = return_mode { audio = return_mode {
"escape" = ""; "escape" = "";
"s" = "exec ${pulse_sink}/bin/pulse_sink"; "s" = "exec ${pulse_sink}/bin/pulse_sink";
}; };
}; };
keybindings = keybindings = let
let
mod = "Mod4"; mod = "Mod4";
floating.modifier = "Mod4"; floating.modifier = "Mod4";
menu = "bemenu-run --bottom"; menu = "bemenu-run --bottom";
@ -459,42 +446,31 @@ in {
"${mod}+8" = "workspace number 8"; "${mod}+8" = "workspace number 8";
"${mod}+9" = "workspace number 9"; "${mod}+9" = "workspace number 9";
"${mod}+0" = "workspace number 10"; "${mod}+0" = "workspace number 10";
"${mod}+Shift+1" = "${mod}+Shift+1" = "move container to workspace number 1";
"move container to workspace number 1"; "${mod}+Shift+2" = "move container to workspace number 2";
"${mod}+Shift+2" = "${mod}+Shift+3" = "move container to workspace number 3";
"move container to workspace number 2"; "${mod}+Shift+4" = "move container to workspace number 4";
"${mod}+Shift+3" = "${mod}+Shift+5" = "move container to workspace number 5";
"move container to workspace number 3"; "${mod}+Shift+6" = "move container to workspace number 6";
"${mod}+Shift+4" = "${mod}+Shift+7" = "move container to workspace number 7";
"move container to workspace number 4"; "${mod}+Shift+8" = "move container to workspace number 8";
"${mod}+Shift+5" = "${mod}+Shift+9" = "move container to workspace number 9";
"move container to workspace number 5"; "${mod}+Shift+0" = "move container to workspace number 10";
"${mod}+Shift+6" =
"move container to workspace number 6";
"${mod}+Shift+7" =
"move container to workspace number 7";
"${mod}+Shift+8" =
"move container to workspace number 8";
"${mod}+Shift+9" =
"move container to workspace number 9";
"${mod}+Shift+0" =
"move container to workspace number 10";
}; };
prev_next_binds = prev_next_binds = let
let
join_dict_arr = builtins.foldl' (a: v: a // v) { }; join_dict_arr = builtins.foldl' (a: v: a // v) { };
maybe_window = key: maybe_window = key:
if (lib.strings.hasInfix "button" key) if (lib.strings.hasInfix "button" key) then
then "--whole-window" "--whole-window"
else ""; else
prev_binds = map (key: "";
{"${maybe_window key} ${mod}+${key}" = "workspace prev_on_output";} prev_binds = map (key: {
) [ key.tabL "bracketleft" "Prior" "button9" "button4" ]; "${maybe_window key} ${mod}+${key}" = "workspace prev_on_output";
next_binds = map (key: }) [ key.tabL "bracketleft" "Prior" "button9" "button4" ];
{"${maybe_window key} ${mod}+${key}" = "workspace next_on_output";} next_binds = map (key: {
) [ key.tabR "bracketright" "Next" "button8" "button5" ]; "${maybe_window key} ${mod}+${key}" = "workspace next_on_output";
in }) [ key.tabR "bracketright" "Next" "button8" "button5" ];
join_dict_arr (prev_binds ++ next_binds); in join_dict_arr (prev_binds ++ next_binds);
movement_binds = { movement_binds = {
"${mod}+${key.left}" = "focus left"; "${mod}+${key.left}" = "focus left";
"${mod}+${key.down}" = "focus down"; "${mod}+${key.down}" = "focus down";
@ -538,19 +514,20 @@ in {
"${mod}+mod1+Shift+Right" = "move workspace output right"; "${mod}+mod1+Shift+Right" = "move workspace output right";
}; };
audio_binds = { audio_binds = {
XF86AudioRaiseVolume = "exec pactl set-sink-volume @DEFAULT_SINK@ +10%"; XF86AudioRaiseVolume =
XF86AudioLowerVolume = "exec pactl set-sink-volume @DEFAULT_SINK@ -10%"; "exec pactl set-sink-volume @DEFAULT_SINK@ +10%";
XF86AudioLowerVolume =
"exec pactl set-sink-volume @DEFAULT_SINK@ -10%";
XF86AudioMute = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; XF86AudioMute = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
XF86AudioMicMute = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; XF86AudioMicMute =
"exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
# Control media # Control media
XF86AudioPlay = "exec playerctl play-pause"; XF86AudioPlay = "exec playerctl play-pause";
XF86AudioPause = "exec playerctl play-pause"; XF86AudioPause = "exec playerctl play-pause";
XF86AudioNext = "exec playerctl next"; XF86AudioNext = "exec playerctl next";
XF86AudioPrev = "exec playerctl previous"; XF86AudioPrev = "exec playerctl previous";
}; };
system_binds = { system_binds = { "Ctrl+${mod}+z" = "exec systemctl suspend"; };
"Ctrl+${mod}+z" = "exec systemctl suspend";
};
in { in {
"${mod}+Return" = "exec ${terminal}"; "${mod}+Return" = "exec ${terminal}";
"${mod}+Ctrl+Return" = "exec thunar"; "${mod}+Ctrl+Return" = "exec thunar";
@ -572,11 +549,7 @@ in {
# "${mod}+Shift+e" = # "${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'"; # "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}+r" = "mode resize"; "${mod}+r" = "mode resize";
} } // workspace_binds // prev_next_binds // movement_binds // audio_binds
// workspace_binds
// prev_next_binds
// movement_binds
// audio_binds
// system_binds // system_binds
# // map (key: "$mod+${key} workspace prev_on_output") [ key.tabL "bracketleft" "Prior" "button9" "button4" ] # // map (key: "$mod+${key} workspace prev_on_output") [ key.tabL "bracketleft" "Prior" "button9" "button4" ]
# // map (key: "$mod+${key} workspace next_on_output") [ key.tabL "bracketleft" "Prior" "button9" "button4" ] # // map (key: "$mod+${key} workspace next_on_output") [ key.tabL "bracketleft" "Prior" "button9" "button4" ]
@ -588,17 +561,18 @@ in {
enable = true; enable = true;
profiles = { profiles = {
sedetary = { sedetary = {
outputs = [{ outputs = [
{
criteria = "eDP-1"; criteria = "eDP-1";
status = "disable"; status = "disable";
position = "1920,312"; position = "1920,312";
} { }
{
criteria = "HDMI-A-1"; criteria = "HDMI-A-1";
position = "0,0"; position = "0,0";
}]; }
exec = [
"xrdb .Xresources"
]; ];
exec = [ "xrdb .Xresources" ];
}; };
nomad = { nomad = {
outputs = [{ outputs = [{
@ -606,9 +580,7 @@ in {
status = "enable"; status = "enable";
position = "1920,312"; position = "1920,312";
}]; }];
exec = [ exec = [ "xrdb .Xresources" ];
"xrdb .Xresources"
];
}; };
}; };
}; };