support for gnome desktop

This commit is contained in:
Leonardo Eugênio 2022-11-07 11:24:40 -03:00
parent 0a1647e0e7
commit f7b9c71006
18 changed files with 155 additions and 143 deletions

View file

@ -35,6 +35,7 @@
}; };
outputs = inputs@{ nixpkgs, nixpkgs-unstable, home-manager, nur, ... }: outputs = inputs@{ nixpkgs, nixpkgs-unstable, home-manager, nur, ... }:
let let
inherit (import ./user/variables.nix) desktop;
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
@ -43,14 +44,13 @@
lib = nixpkgs.lib; lib = nixpkgs.lib;
common_modules = [ common_modules = [
./system/configuration.nix ./system/configuration.nix
./system/sway.nix
# nur.nixosModules.nur # nur.nixosModules.nur
inputs.hyprland.nixosModules.default inputs.hyprland.nixosModules.default
{ {
programs.hyprland.enable = true; programs.hyprland.enable = true;
# programs.hyprland.package = null; # programs.hyprland.package = null;
} }
(import ./overlays (inputs // {inherit system;})) (import ./overlays (inputs // { inherit system; }))
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
@ -61,7 +61,8 @@
# arguments to home.nix # arguments to home.nix
home-manager.extraSpecialArgs = { inherit inputs; }; home-manager.extraSpecialArgs = { inherit inputs; };
} }
]; ] ++ lib.optional (desktop == "sway") ./system/sway.nix
++ lib.optional (desktop == "gnome") ./system/gnome.nix;
in { in {
nixosConfigurations = { nixosConfigurations = {
i15 = lib.nixosSystem { i15 = lib.nixosSystem {
@ -70,10 +71,8 @@
}; };
monolith = lib.nixosSystem { monolith = lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [ ./hosts/monolith.nix ./system/gitlab-runner.nix ]
./hosts/monolith.nix ++ common_modules;
./system/gitlab-runner.nix
] ++ common_modules;
}; };
rainbow = lib.nixosSystem { rainbow = lib.nixosSystem {
inherit system; inherit system;

View file

@ -1,8 +1,8 @@
# 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, ... }: let { config, lib, pkgs, modulesPath, ... }:
btrfs_options = [ "compress=zstd:3" "noatime" ]; let btrfs_options = [ "compress=zstd:3" "noatime" ];
in { in {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = boot.initrd.availableKernelModules =

View file

@ -4,33 +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 = [ "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/mapper/pixie"; device = "/dev/mapper/pixie";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=nixos" ]; options = [ "subvol=nixos" ];
}; };
boot.initrd.luks.devices."pixie".device = "/dev/disk/by-uuid/f4ae5858-d2d6-4cd1-a054-bf5147a9a928"; boot.initrd.luks.devices."pixie".device =
"/dev/disk/by-uuid/f4ae5858-d2d6-4cd1-a054-bf5147a9a928";
fileSystems."/home" = fileSystems."/home" = {
{ device = "/dev/mapper/pixie"; device = "/dev/mapper/pixie";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=home" ]; options = [ "subvol=home" ];
}; };
fileSystems."/boot/efi" = fileSystems."/boot/efi" = {
{ device = "/dev/disk/by-uuid/B1BB-15DD"; device = "/dev/disk/by-uuid/B1BB-15DD";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ ]; swapDevices = [ ];
@ -45,7 +45,8 @@
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
# networking.interfaces.veth74f3ffc.useDHCP = lib.mkDefault true; # networking.interfaces.veth74f3ffc.useDHCP = lib.mkDefault true;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
networking.hostName = "pixie"; # Define your hostname. networking.hostName = "pixie"; # Define your hostname.
} }

View file

@ -1,42 +1,42 @@
# 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, ... }: let { config, lib, pkgs, modulesPath, ... }:
btrfs_options = [ "compress=zstd:3" "noatime" ]; let btrfs_options = [ "compress=zstd:3" "noatime" ];
in { in {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "usb_storage" "usbhid" "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/a242e1fd-6848-4504-909f-ab8b61f97c8e"; device = "/dev/disk/by-uuid/a242e1fd-6848-4504-909f-ab8b61f97c8e";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@nixos" ] ++ btrfs_options; options = [ "subvol=@nixos" ] ++ btrfs_options;
}; };
boot.initrd.luks.devices."main".device = "/dev/disk/by-uuid/9b24d79f-e018-4d70-84a9-5a1b49a6c610"; boot.initrd.luks.devices."main".device =
"/dev/disk/by-uuid/9b24d79f-e018-4d70-84a9-5a1b49a6c610";
fileSystems."/home" = fileSystems."/home" = {
{ device = "/dev/disk/by-uuid/a242e1fd-6848-4504-909f-ab8b61f97c8e"; device = "/dev/disk/by-uuid/a242e1fd-6848-4504-909f-ab8b61f97c8e";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@home" ] ++ btrfs_options; options = [ "subvol=@home" ] ++ btrfs_options;
}; };
fileSystems."/boot/efi" = fileSystems."/boot/efi" = {
{ device = "/dev/disk/by-uuid/DC3B-5753"; device = "/dev/disk/by-uuid/DC3B-5753";
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/swap" = fileSystems."/swap" = {
{ device = "/dev/disk/by-uuid/a242e1fd-6848-4504-909f-ab8b61f97c8e"; device = "/dev/disk/by-uuid/a242e1fd-6848-4504-909f-ab8b61f97c8e";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@swap" ]; options = [ "subvol=@swap" ];
}; };
swapDevices = [{ swapDevices = [{
device = "/swap/swapfile"; device = "/swap/swapfile";
@ -51,7 +51,8 @@ in {
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; # networking.interfaces.enp1s0.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 = "rainbow"; # Define your hostname. networking.hostName = "rainbow"; # Define your hostname.
} }

View file

@ -1,44 +1,44 @@
(inputs@{ system, ... }: {pkgs, ...}: { (inputs@{ system, ... }:
nixpkgs.overlays = [ { pkgs, ... }: {
inputs.nur.overlay nixpkgs.overlays = [
(import ../scripts) inputs.nur.overlay
(import ./sway.nix) (import ../scripts)
(final: prev: { (import ./sway.nix)
unstable = inputs.nixpkgs-unstable.legacyPackages.${prev.system}; (final: prev: {
}) unstable = inputs.nixpkgs-unstable.legacyPackages.${prev.system};
(final: prev: { })
uservars = import ../user/variables.nix; (final: prev: {
dhist = inputs.dhist.packages.${system}.dhist; uservars = import ../user/variables.nix;
mpvpaper = inputs.wegank.packages.${prev.system}.mpvpaper; dhist = inputs.dhist.packages.${system}.dhist;
alacritty = (prev.unstable.alacritty.overrideAttrs mpvpaper = inputs.wegank.packages.${prev.system}.mpvpaper;
(old-alacritty: rec { alacritty = (prev.unstable.alacritty.overrideAttrs (old-alacritty: rec {
src = inputs.alacritty-sixel; src = inputs.alacritty-sixel;
cargoDeps = old-alacritty.cargoDeps.overrideAttrs cargoDeps = old-alacritty.cargoDeps.overrideAttrs (prev.lib.const {
(prev.lib.const { inherit src;
inherit src; outputHash = "sha256-svZ/ySK09m4KVJE5LBLtD7ZEoExGwpFn4UP5tfhGKMc=";
outputHash = "sha256-svZ/ySK09m4KVJE5LBLtD7ZEoExGwpFn4UP5tfhGKMc="; });
});
})); }));
ranger = (prev.ranger.overridePythonAttrs (old-ranger: rec { ranger = (prev.ranger.overridePythonAttrs (old-ranger: rec {
src = inputs.ranger-sixel; src = inputs.ranger-sixel;
checkInputs = [ ]; checkInputs = [ ];
propagatedBuildInputs = with prev.python3Packages; propagatedBuildInputs = with prev.python3Packages;
old-ranger.propagatedBuildInputs ++ [ astroid pylint pytest ]; old-ranger.propagatedBuildInputs ++ [ astroid pylint pytest ];
})); }));
material-wifi-icons = final.stdenv.mkDerivation rec { material-wifi-icons = final.stdenv.mkDerivation rec {
name = "material-wifi-icons"; name = "material-wifi-icons";
src = inputs.material-wifi-icons; src = inputs.material-wifi-icons;
installPhase = let dest = "$out/share/fonts/${name}"; installPhase = let dest = "$out/share/fonts/${name}";
in '' in ''
mkdir -p ${dest} mkdir -p ${dest}
cp material-wifi.ttf ${dest} cp material-wifi.ttf ${dest}
''; '';
}; };
papirus_red = (final.unstable.papirus-icon-theme.override { color = "red"; }); papirus_red =
orchis_theme_compact = (final.unstable.papirus-icon-theme.override { color = "red"; });
(final.orchis-theme.override { tweaks = [ "compact" "solid" ]; }); orchis_theme_compact =
nerdfonts_fira_hack = (final.orchis-theme.override { tweaks = [ "compact" "solid" ]; });
(final.nerdfonts.override { fonts = [ "FiraCode" "Hack" ]; }); nerdfonts_fira_hack =
}) (final.nerdfonts.override { fonts = [ "FiraCode" "Hack" ]; });
]; })
}) ];
})

View file

@ -27,8 +27,8 @@
wpass = [ final.wdmenu fd pass sd wl-clipboard wtype ]; wpass = [ final.wdmenu fd pass sd wl-clipboard wtype ];
screenshotsh = screenshotsh =
[ capitaine-cursors grim slurp jq sway wl-clipboard xdg-user-dirs ]; [ capitaine-cursors grim slurp jq sway wl-clipboard xdg-user-dirs ];
volumesh = [ pulseaudio libnotify ]; volumesh = [ pulseaudio libnotify ];
pulse_sink = [ pulseaudio pamixer final.wdmenu ]; pulse_sink = [ pulseaudio pamixer final.wdmenu ];
} // lib.mapAttrs import_script { } // lib.mapAttrs import_script {
wdmenu = ./wdmenu.nix; wdmenu = ./wdmenu.nix;
wlauncher = ./wlauncher.nix; wlauncher = ./wlauncher.nix;

View file

@ -2,9 +2,7 @@
# 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, ... }: {
imports = [ imports = [ ./media-packages.nix ];
./media-packages.nix
];
packages.media-packages.enable = true; packages.media-packages.enable = true;
# Bootloader. # Bootloader.
@ -31,12 +29,12 @@
time.timeZone = "America/Sao_Paulo"; time.timeZone = "America/Sao_Paulo";
# Select internationalisation properties. # Select internationalisation properties.
i18n.defaultLocale = "pt_BR.utf8"; i18n.defaultLocale = "pt_BR.utf8";
# Enable the X11 windowing system.
services.xserver.enable = false;
# Enable the GNOME Desktop Environment. # Enable the GNOME Desktop Environment.
# services.xserver.displayManager.gdm.enable = true; # services.xserver.displayManager.gdm.enable = true;
# services.xserver.desktopManager.gnome.enable = true; # services.xserver.desktopManager.gnome.enable = true;
# services.xserver.displayManager.autologin.user = "lelgenio"; # services.xserver.displayManager.autologin.user = "lelgenio";
# Configure keymap in X11 # Configure keymap in X11
services.xserver = { services.xserver = {
layout = "us"; layout = "us";
@ -53,7 +51,7 @@
## Enable sound with pipewire. ## Enable sound with pipewire.
sound.enable = true; sound.enable = true;
# hardware.pulseaudio.enable = true; hardware.pulseaudio.enable = false;
services.pipewire = { services.pipewire = {
enable = true; enable = true;
wireplumber.enable = true; wireplumber.enable = true;

16
system/gnome.nix Normal file
View file

@ -0,0 +1,16 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }: {
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# services.xserver.displayManager.autologin.user = "lelgenio";
environment.systemPackages = with pkgs;
with gnome; [
gnome-tweaks
dconf-editor
];
}

View file

@ -1,6 +1,5 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let cfg = config.packages.media-packages;
cfg = config.packages.media-packages;
in { in {
options.packages.media-packages = { options.packages.media-packages = {
enable = lib.mkEnableOption "media packages"; enable = lib.mkEnableOption "media packages";

View file

@ -1,4 +1,8 @@
{ pkgs, ... }: { { pkgs, ... }: {
# Enable the X11 windowing system.
services.xserver.enable = false;
# enable sway window manager # enable sway window manager
programs.sway = { programs.sway = {
enable = true; enable = true;

View file

@ -29,9 +29,7 @@ in {
}; };
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [ tdesktop ];
tdesktop
];
home.activation = { home.activation = {
install_flatpaks = lib.hm.dag.entryAfter [ "writeBoundary" ] '' install_flatpaks = lib.hm.dag.entryAfter [ "writeBoundary" ] ''

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, font, ... }: { config, pkgs, lib, font, ... }:
let inherit (import ./variables.nix) key theme color accent font; let inherit (import ./variables.nix) desktop;
in { in {
config = { config = {
programs.firefox = { programs.firefox = {
@ -16,23 +16,21 @@ in {
main = { main = {
isDefault = true; isDefault = true;
settings = { settings = {
"devtools.theme" = "dark"; "devtools.theme" = "auto";
"toolkit.legacyUserProfileCustomizations.stylesheets" = true; "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"browser.tabs.inTitlebar" = 0; "browser.tabs.inTitlebar" = if desktop == "sway" then 0 else 1;
"media.ffmpeg.vaapi.enabled" = true; "media.ffmpeg.vaapi.enabled" = true;
"media.ffvpx.enabled" = false; "media.ffvpx.enabled" = true;
"media.av1.enabled" = false; "media.av1.enabled" = true;
"gfx.webrender.all" = true; "gfx.webrender.all" = true;
}; };
userChrome = '' userChrome = lib.mkIf (desktop == "sway") ''
#titlebar { display: none !important; } #titlebar { display: none !important; }
''; '';
}; };
}; };
}; };
home.sessionVariables = { home.sessionVariables = { MOZ_ENABLE_WAYLAND = "1"; };
MOZ_ENABLE_WAYLAND = "1";
};
}; };
} }

View file

@ -1,5 +1,6 @@
{ config, pkgs, lib, inputs, ... }: { config, pkgs, lib, inputs, ... }:
let inherit (import ./variables.nix) key theme color accent font; let
inherit (import ./variables.nix) key theme color accent font;
colors = { colors = {
"bg+" = color.bg_light; "bg+" = color.bg_light;
@ -21,14 +22,13 @@ in {
enable = true; enable = true;
fileWidgetCommand = "${pkgs.fd}/bin/fd --type f"; fileWidgetCommand = "${pkgs.fd}/bin/fd --type f";
fileWidgetOptions = [ "--preview '${pkgs.bat}/bin/bat --style=numbers --color=always {}'" ]; fileWidgetOptions =
[ "--preview '${pkgs.bat}/bin/bat --style=numbers --color=always {}'" ];
changeDirWidgetCommand = "${pkgs.fd}/bin/fd --type d"; changeDirWidgetCommand = "${pkgs.fd}/bin/fd --type d";
changeDirWidgetOptions = [ "--preview '${pkgs.exa}/bin/exa -T L3 | head -200'" ]; changeDirWidgetOptions =
[ "--preview '${pkgs.exa}/bin/exa -T L3 | head -200'" ];
defaultOptions = [ defaultOptions = [ color_opts preview_opts ];
color_opts
preview_opts
];
}; };
} }

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, inputs, ... }: { config, pkgs, lib, inputs, ... }:
let inherit (import ./variables.nix) key theme color accent font; let inherit (import ./variables.nix) key theme color accent font desktop;
in { in {
imports = [ imports = [
@ -8,7 +8,6 @@ in {
./kakoune.nix ./kakoune.nix
./fish.nix ./fish.nix
./firefox.nix ./firefox.nix
./sway.nix
./hyprland.nix ./hyprland.nix
./alacritty.nix ./alacritty.nix
./git.nix ./git.nix
@ -24,9 +23,9 @@ in {
./bmenu.nix ./bmenu.nix
./fzf.nix ./fzf.nix
./ranger ./ranger
./theme.nix
inputs.hyprland.homeManagerModules.default inputs.hyprland.homeManagerModules.default
]; ] ++ lib.optional (desktop == "sway") ./sway.nix;
# Home Manager needs a bit of information about you and the # Home Manager needs a bit of information about you and the
# paths it should manage. # paths it should manage.
home.username = "lelgenio"; home.username = "lelgenio";
@ -77,14 +76,12 @@ in {
libsForQt5.qtstyleplugins libsForQt5.qtstyleplugins
qt5.qtsvg qt5.qtsvg
## Network ## Network
speedtest-cli speedtest-cli
nmap nmap
miniupnpc miniupnpc
deluge deluge
## Programming ## Programming
vscode vscode
rustup rustup

View file

@ -25,6 +25,7 @@ let
fi fi
''; '';
in { in {
imports = [ ./theme.nix ];
config = { config = {
wayland.windowManager.sway = let wayland.windowManager.sway = let
mod = "Mod4"; mod = "Mod4";

View file

@ -34,7 +34,7 @@ with pkgs.uservars; {
[Appearance] [Appearance]
# color_scheme_path=/nix/store/f07mk0vrm47jxw3y5v99hxncy0w4vcyq-qt5ct-1.5/share/qt5ct/colors/darker.conf # color_scheme_path=/nix/store/f07mk0vrm47jxw3y5v99hxncy0w4vcyq-qt5ct-1.5/share/qt5ct/colors/darker.conf
custom_palette=false custom_palette=false
icon_theme=${ icon_theme } icon_theme=${icon_theme}
standard_dialogs=default standard_dialogs=default
style=kvantum-dark style=kvantum-dark
@ -46,18 +46,16 @@ with pkgs.uservars; {
services.xsettingsd = { services.xsettingsd = {
enable = true; enable = true;
settings = { settings = {
"Gtk/FontName" = "${ font.interface } ${toString font.size.small }"; "Gtk/FontName" = "${font.interface} ${toString font.size.small}";
"Net/ThemeName" = "${ gtk_theme }"; "Net/ThemeName" = "${gtk_theme}";
"Net/IconThemeName" = "${ icon_theme }"; "Net/IconThemeName" = "${icon_theme}";
"Gtk/CursorThemeName" = "${ cursor_theme }"; "Gtk/CursorThemeName" = "${cursor_theme}";
"Gtk/CursorThemeSize" = 24; "Gtk/CursorThemeSize" = 24;
"Net/SoundThemeName" = "freedesktop" ; "Net/SoundThemeName" = "freedesktop";
}; };
}; };
home.sessionVariables = { home.sessionVariables = { QT_QPA_PLATFORMTHEME = "qt5ct"; };
QT_QPA_PLATFORMTHEME = "qt5ct";
};
home.packages = with pkgs; [ home.packages = with pkgs; [
libsForQt5.qt5ct libsForQt5.qt5ct
libsForQt5.qtstyleplugin-kvantum libsForQt5.qtstyleplugin-kvantum

View file

@ -96,4 +96,5 @@ in rec {
}; };
dmenu = "bmenu"; dmenu = "bmenu";
desktop = "sway";
} }

View file

@ -102,7 +102,8 @@ in {
format-bluetooth-muted = ""; format-bluetooth-muted = "";
format-muted = ""; format-muted = "";
format-icons = { format-icons = {
"alsa_output.pci-0000_09_00.4.analog-stereo" = [ " " " 奔" " " ]; "alsa_output.pci-0000_09_00.4.analog-stereo" =
[ " " " 奔" " " ];
headphone = [ " " " 奔" " " ]; headphone = [ " " " 奔" " " ];
handsfree = ""; handsfree = "";