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";
home-manager.url = "github:nix-community/home-manager/release-22.05";
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, ... }:
let
@ -26,7 +26,9 @@
common_modules = [
./system/configuration.nix
# 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.useGlobalPkgs = true;
@ -41,15 +43,13 @@
nixosConfigurations = {
i15 = lib.nixosSystem {
inherit system;
modules = [
./system/i15-hardware-configuration.nix
] ++ common_modules;
modules = [ ./system/i15-hardware-configuration.nix ]
++ common_modules;
};
monolith = lib.nixosSystem {
inherit system;
modules = [
./system/monolith-hardware-configuration.nix
] ++ common_modules;
modules = [ ./system/monolith-hardware-configuration.nix ]
++ common_modules;
};
};
};

View file

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

View file

@ -1,26 +1,23 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_usb_sdmmc" ];
{ config, lib, pkgs, modulesPath, ... }: {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_usb_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/67af2da1-b4a8-4c32-a7e8-c1d0a8de21ab";
fileSystems."/" = {
device = "/dev/disk/by-uuid/67af2da1-b4a8-4c32-a7e8-c1d0a8de21ab";
fsType = "ext4";
};
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/1428-8899";
fileSystems."/boot/efi" = {
device = "/dev/disk/by-uuid/1428-8899";
fsType = "vfat";
};
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
# (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
@ -29,6 +26,7 @@
# networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
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.
}

View file

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

View file

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