diff --git a/base/default.nix b/base/default.nix deleted file mode 100644 index 2fd0713..0000000 --- a/base/default.nix +++ /dev/null @@ -1,106 +0,0 @@ -# Edet 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, - lib, - ... -}: { - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration-custom.nix - ]; - - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.tmp.useTmpfs = true; - boot.kernelPackages = pkgs.linuxPackages_latest; - - networking.hostName = "posixlycorrect"; # Define your hostname. !!mover esto a platform - networking.networkmanager.enable = true; - - # Set your time zone. - time.timeZone = "America/Costa_Rica"; - - # The global useDHCP flag is deprecated, therefore explicitly set to false here. - # Per-interface useDHCP will be mandatory in the future, so this generated config - # replicates the default behaviour. - networking.useDHCP = false; - networking.interfaces.enp7s0.useDHCP = true; - networking.interfaces.wlp6s0.useDHCP = true; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - console = { - font = "Lat2-Terminus16"; - keyMap = "us"; - }; - - # Enable the X11 windowing system. - services.xserver = { - enable = true; - xkb.layout = "us"; - displayManager.startx.enable = true; - }; - services.libinput.enable = true; - - hardware.opengl.enable = true; - - # Enable sound. - sound.enable = true; - hardware.pulseaudio.enable = true; - - programs.zsh.enable = true; - environment.pathsToLink = ["/share/zsh"]; - - users = { - users.fabian = { - isNormalUser = true; - uid = 1002; # nunca cambiar mi ID de usuario - group = "fabian"; - shell = pkgs.zsh; - extraGroups = ["users" "wheel" "networkmanager" "dialout" "libvirtd"]; - }; - groups.fabian.gid = 1002; - }; - - services.udev.packages = [ - pkgs.android-udev-rules - ]; - - users.users.temp = { - isNormalUser = true; - extraGroups = ["wheel"]; - }; - - nixpkgs.config.allowUnfree = true; - - virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm; - virtualisation.libvirtd.qemu.ovmf.enable = true; - virtualisation.libvirtd.qemu.ovmf.packages = [pkgs.OVMFFull.fd]; - virtualisation.libvirtd.enable = true; - programs.dconf.enable = true; - # boot.kernelModules = [ "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd" ]; - # boot.kernelParams = [ "amd_iommu=on" "iommu=pt" "vfio-pci.ids=1002:699f,1002:aae0" "video=efifb:off" ]; - virtualisation.libvirtd.onBoot = "start"; - - nix = { - package = pkgs.nixFlakes; - extraOptions = '' - experimental-features = nix-command flakes repl-flake - ''; - }; - - hardware.opengl.driSupport32Bit = true; - - services.openssh.enable = true; - - services.earlyoom = { - enable = true; - enableNotifications = true; - }; - - system.stateVersion = "21.11"; # No tocar esto -} diff --git a/base/hardware-configuration-custom.nix b/base/hardware-configuration-custom.nix deleted file mode 100644 index a9feac6..0000000 --- a/base/hardware-configuration-custom.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: let - subvol = subvol: { - device = "/dev/disk/by-uuid/645fdba0-5c03-4285-926b-facded1ee259"; - fsType = "btrfs"; - options = ["subvol=${subvol}" "compress=zstd" "noatime" "ssd"]; - }; -in { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd = { - availableKernelModules = ["xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; - luks.devices."toplevel" = { - device = "/dev/disk/by-uuid/58277baa-90d4-4a5e-a658-1b918b89130a"; - preLVM = false; - }; - }; - - fileSystems = { - "/" = subvol "root"; - "/toplevel" = subvol "/"; - "/boot" = { - device = "/dev/disk/by-uuid/B007-B007"; - fsType = "vfat"; - options = ["umask=027"]; - }; - - "/extern" = { - device = "/dev/disk/by-uuid/7d8d3ec9-b456-4e2a-9396-551dcaf7705b"; - fsType = "btrfs"; - options = ["noatime" "compress=zstd"]; - }; - }; - - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/base/platforms/posixlycorrect.nix b/base/platforms/posixlycorrect.nix deleted file mode 100644 index 0967ef4..0000000 --- a/base/platforms/posixlycorrect.nix +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 44a5cb7..0000000 --- a/flake.lock +++ /dev/null @@ -1,148 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "hm-isolation": { - "locked": { - "lastModified": 1675806557, - "narHash": "sha256-39NPKKwU7JflyDG9Cn36UPPelkcNATsrCaoazuIO5PA=", - "owner": "3442", - "repo": "hm-isolation", - "rev": "0b435299c3735231bf4faf1ea7de32d03f070056", - "type": "github" - }, - "original": { - "owner": "3442", - "repo": "hm-isolation", - "type": "github" - } - }, - "home-manager": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1720042825, - "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "release-24.05", - "repo": "home-manager", - "type": "github" - } - }, - "nixGL": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1713543440, - "narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=", - "owner": "guibou", - "repo": "nixGL", - "rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a", - "type": "github" - }, - "original": { - "owner": "guibou", - "repo": "nixGL", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1660551188, - "narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1725001927, - "narHash": "sha256-eV+63gK0Mp7ygCR0Oy4yIYSNcum2VQwnZamHxYTNi+M=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "6e99f2a27d600612004fbd2c3282d614bfee6421", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nur": { - "locked": { - "lastModified": 1725475632, - "narHash": "sha256-is3Pft+K3MLR+nFQcjzmfvi4SVrguP7yDadfcFM0tQo=", - "owner": "nix-community", - "repo": "NUR", - "rev": "d7ea0f74c7194ded318f12320724f481899d196a", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "NUR", - "type": "github" - } - }, - "root": { - "inputs": { - "hm-isolation": "hm-isolation", - "home-manager": "home-manager", - "nixGL": "nixGL", - "nixpkgs": "nixpkgs_2", - "nur": "nur", - "unstable": "unstable" - } - }, - "unstable": { - "locked": { - "lastModified": 1725103162, - "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix index 90e0a58..b12f141 100644 --- a/flake.nix +++ b/flake.nix @@ -12,77 +12,150 @@ impermanence.url = "github:nix-community/impermanence"; hm-isolation.url = "github:3442/hm-isolation"; nixGL.url = "github:guibou/nixGL"; - flake-utils.url = "github:numtide/flake-utils"; + vpsadminos.url = "github:vpsfreecz/vpsadminos"; + + + homepage.url = "git+https://git.posixlycorrect.com/fabian/homepage.git?ref=master"; + + conduwuit = { + url = "github:girlbossceo/conduwuit?ref=v0.4.5"; + #FIXME: Podrá volver a "nixpkgs" una vez que rocksdb.enableLiburing llegue a stable + inputs.nixpkgs.follows = "unstable"; + }; + + authentik-nix = { + url = "github:nix-community/authentik-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + mediawikiSkinCitizen = { + url = "github:StarCitizenTools/mediawiki-skins-Citizen/v2.27.0"; + flake = false; + }; }; - outputs = { + outputs = flakes @ { self, nixpkgs, unstable, home-manager, nur, + impermanence, hm-isolation, nixGL, - ... + flake-utils, + vpsadminos, + homepage, + conduwuit, + mediawikiSkinCitizen, + authentik-nix, }: let system = "x86_64-linux"; - pkgs = import nixpkgs { + importPkgs = flake: import flake { inherit system; + + config = import ./pkgs/config nixpkgs.lib; + overlays = [ nur.overlay self.overlays.default ]; }; - inherit (pkgs) lib; + pkgs = importPkgs nixpkgs; - base = platform: { - name = platform; - value = nixpkgs.lib.nixosSystem { - inherit system; + inherit (pkgs.local.lib) importAll; - modules = [(import ./base)]; + local = import ./pkgs; + + in + with pkgs.lib; { + formatter.${system} = pkgs.alejandra; + packages.${system} = pkgs.local; + + overlays.default = final: prev: + let + locals = local final prev; + in + locals.override // { + local = locals; + unstable = importPkgs unstable; }; - }; - home = platform: { - name = "fabian@${platform}"; - value = home-manager.lib.homeManagerConfiguration { - inherit pkgs; + nixosConfigurations = + let + nixosSystem = { modules }: makeOverridable nixpkgs.lib.nixosSystem { + inherit modules pkgs system; + specialArgs = { + inherit flakes; + }; + }; + + hostConfig = host: nixosSystem { modules = [ - (import ./home { - inherit self nixpkgs unstable hm-isolation nixGL; - }) - - ./home/platforms/${platform}.nix - - { - config.local = {inherit platform;}; - } + ./sys + host ]; }; + + in + mapAttrs (_: hostConfig) (importAll { root = ./sys/platforms; }); + + + homeConfigurations = + let + registry = { ... }: { + config.nix.registry = mapAttrs ( + _: value { + flake = value; + } + ) flakes; }; - localPkgs = import ./pkgs; + home = platform: home-manager.lib.homeManagerConfiguration { + inherit pkgs; - platforms = domain: - map - (lib.removeSuffix ".nix") - (lib.attrNames (builtins.readDir ./${domain}/platforms)); - - configs = domain: builder: - lib.listToAttrs - (map builder (platforms domain)); - in { - nixosConfigurations = configs "base" base; - homeConfigurations = configs "home" home; - packages.${system} = localPkgs pkgs; - formatter.${system} = pkgs.alejandra; - - overlay = self: super: { - unstable = import unstable { - inherit (super) config system; - }; - local = localPkgs self; + modules = [ + ./home + platforms + registry + hm-isolation.homeManagerModule + ]; }; + + platformHome = platform: + let + value = home platform; + in + { + inherit value; + name = "${value.config.home.username}@${value.config.local.hostname}"; + }; + in + mapAttrs' (_: platformHome) (importAll { root = ./home/platforms; }); }; + + + + + + + + + + + + + + + + + + + + + + + + + } diff --git a/home/accounts.nix b/home/accounts.nix deleted file mode 100644 index 97e7647..0000000 --- a/home/accounts.nix +++ /dev/null @@ -1,82 +0,0 @@ -{ - lib, - config, - ... -}: -with lib; { - config = mkIf (!config.home.isolation.active) { - accounts.email.maildirBasePath = "${config.home.homeDirectory}/mail"; - accounts.email.accounts = { - "default" = { - address = "fabian@posixlycorrect.com"; - userName = "fabianmontero@fastmail.com"; - realName = "fabian"; - primary = true; - flavor = "fastmail.com"; - - smtp = { - host = "smtp.fastmail.com"; - port = 465; - }; - imap = { - host = "imap.fastmail.com"; - port = 993; - tls.enable = true; - }; - - passwordCommand = "gpg -d ${config.home.homeDirectory}/secrets/fastmail.password.gpg 2> /dev/null"; - - gpg = { - encryptByDefault = true; - signByDefault = true; - key = "7AA277E604A4173916BBB4E91FFAC35E1798174F"; - }; - - thunderbird = { - enable = true; - settings = id: { - "mail.openpgp.allow_external_gnupg" = true; - }; - }; - neomutt = { - enable = true; - }; - - mbsync = { - enable = true; - create = "both"; - expunge = "both"; - remove = "both"; - }; - }; - }; - - programs = { - mbsync.enable = true; - thunderbird = { - enable = true; - profiles = { - "default" = { - isDefault = true; - }; - }; - }; - neomutt = { - enable = true; - sort = "date-received"; - vimKeys = true; - sidebar = { - enable = true; - }; - #settings = { - # maildir_check_cur = "yes"; - #}; - extraConfig = '' - mailboxes `find ~/mail/ -type d -name cur -printf '%h '` - timeout-hook 'echo `mbsync -a`' - startup-hook 'echo `mbsync -a`' - ''; - }; - }; - }; -} diff --git a/home/allowUnfreeWhitelist.nix b/home/allowUnfreeWhitelist.nix deleted file mode 100644 index a71519f..0000000 --- a/home/allowUnfreeWhitelist.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - pkgs, - config, - lib, - ... -}: -with lib; { - nixpkgs.config.allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ - "discord" - "pycharm-professional" - "rar" - "spotify" - "spotify-unwrapped" - "steam" - "steam-original" - "steam-run" - "teams" - "vscode-extension-ms-vscode-cpptools" - "vmware-horizon-client" - "zoom" - ]; -} diff --git a/home/apps/default.nix b/home/apps/default.nix deleted file mode 100644 index 9155e3a..0000000 --- a/home/apps/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; let - cfg = config.local.apps; -in { - options.local.apps.enable = mkEnableOption "Applications and tools"; - imports = [ - ./library.nix - ./steam - ./terminal - ./virtmanager.nix - ]; -} diff --git a/home/apps/library.nix b/home/apps/library.nix deleted file mode 100644 index ffc3f5b..0000000 --- a/home/apps/library.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; let - cfg = config.local.apps.defaultApps; -in { - options.local.apps.defaultApps.enable = mkEnableOption "Default app library"; - config = mkIf cfg.enable { - home.packages = with pkgs; [ - chromium - darktable - deluge - discord - element-desktop - firefox - gperftools - gwenview - helix - libreoffice-fresh - lutris - mpv - neovim - obs-studio - openrct2 - pavucontrol - pdfarranger - prismlauncher - qpdfview - runelite - spotify - tdesktop - vlc - vpsfree-client - vscodium-fhs - zola - zoom-us - ]; - - xdg.mimeApps.defaultApplications = { - "application/x-extension-htm" = ["firefox.desktop"]; - "application/x-extension-html" = ["firefox.desktop"]; - "application/x-extension-shtml" = ["firefox.desktop"]; - "application/x-extension-xht" = ["firefox.desktop"]; - "application/x-extension-xhtml" = ["firefox.desktop"]; - "application/xhtml+xml" = ["firefox.desktop"]; - "text/html" = ["firefox.desktop"]; - "x-scheme-handler/http" = ["firefox.desktop"]; - "x-scheme-handler/https" = ["firefox.desktop"]; - "application/pdf" = ["qpdfview.desktop"]; - }; - }; -} diff --git a/home/apps/steam/default.nix b/home/apps/steam/default.nix deleted file mode 100644 index 534d4ae..0000000 --- a/home/apps/steam/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: -with lib; let - cfg = config.local.apps.steam; -in { - options.local.apps.steam.enable = mkEnableOption "Steam"; - config = mkIf cfg.enable { - home.packages = [ - (pkgs.callPackage ./package.nix {}) - pkgs.protonup - pkgs.winetricks - pkgs.protontricks - ]; - }; -} diff --git a/home/apps/steam/package.nix b/home/apps/steam/package.nix deleted file mode 100644 index 19f241f..0000000 --- a/home/apps/steam/package.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - writeShellScriptBin, - steam-run, - steam, - ... -}: -writeShellScriptBin "steam" '' - exec ${steam-run}/bin/steam-run ${steam}/bin/steam -console -'' diff --git a/home/apps/terminal/default.nix b/home/apps/terminal/default.nix deleted file mode 100644 index a32486d..0000000 --- a/home/apps/terminal/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; let - cfg = config.local.apps.terminal; -in { - options.local.apps.terminal.enable = mkEnableOption "Terminal emulator settings"; - config.programs = mkIf cfg.enable { - kitty = { - enable = true; - extraConfig = import ./kitty.conf.nix; - }; - - tmux = { - enable = true; - aggressiveResize = true; - clock24 = true; - escapeTime = 10; - terminal = "xterm-256color"; - keyMode = "emacs"; - - extraConfig = '' - set -g mouse on - set -ga update-environment " LIFT_PID" - set -g set-titles on - set -g renumber-windows on - set -sa terminal-overrides ',xterm-termite:RGB' - set -g status-right "#{?window_bigger,[#{window_offset_x}#,#{window_offset_y}] ,} %H:%M %d-%b-%y" - ''; - }; - }; -} diff --git a/home/apps/terminal/kitty.conf.nix b/home/apps/terminal/kitty.conf.nix deleted file mode 100644 index 82904a9..0000000 --- a/home/apps/terminal/kitty.conf.nix +++ /dev/null @@ -1,87 +0,0 @@ -'' - # Fonts - font_family JetBrains Mono Medium - bold_font JetBrains Mono Bold - italic_font JetBrains Mono Italic - bold_italic_font JetBrains Mono Bold Italic - - font_size 15 - disable_ligatures cursor - - initial_window_width 1200 - initial_window_height 600 - - # Cursor - cursor_shape beam - cursor_beam_thickness 1.9 - cursor_stop_blinking_after 0 - - # Audio - enable_audio_bell no - - # Tabs - tab_bar_style separator - tab_separator " | " - tab_title_template "{index}: {title}" - - # Color - # special - foreground #ffffff - foreground_bold #ffffff - cursor #ffffff - background #000000 - background_opacity 1 - - # Shortcuts - map ctrl+shift+c copy_to_clipboard - map ctrl+shift+v paste_from_clipboard - map ctrl+shift+s paste_from_selection - map shift+insert paste_from_selection - - map ctrl+shift+up scroll_line_up - map ctrl+shift+down scroll_line_down - map ctrl+shift+page_up scroll_page_up - map ctrl+shift+page_down scroll_page_down - map ctrl+shift+home scroll_home - map ctrl+shift+end scroll_end - - map ctrl+shift+enter new_window - map ctrl+alt+enter launch --cwd=current - map ctrl+shift+w close_window - map ctrl+shift+] next_window - map ctrl+shift+[ previous_window - map ctrl+shift+1 first_window - map ctrl+shift+2 second_window - map ctrl+shift+3 third_window - map ctrl+shift+4 fourth_window - map ctrl+shift+5 fifth_window - map ctrl+shift+6 sixth_window - map ctrl+shift+7 seventh_window - map ctrl+shift+8 eighth_window - map ctrl+shift+9 ninth_window - map ctrl+shift+0 tenth_window - - map ctrl+shift+right next_tab - map ctrl+shift+left previous_tab - map ctrl+shift+t new_tab - map ctrl+shift+q close_tab - map ctrl+shift+. move_tab_forward - map ctrl+shift+, move_tab_backward - map ctrl+shift+alt+t set_tab_title - map ctrl+alt+1 goto_tab 1 - map ctrl+alt+2 goto_tab 2 - map ctrl+alt+3 goto_tab 3 - map ctrl+alt+4 goto_tab 4 - map ctrl+alt+5 goto_tab 5 - map ctrl+alt+6 goto_tab 6 - map ctrl+alt+7 goto_tab 7 - map ctrl+alt+8 goto_tab 8 - map ctrl+alt+9 goto_tab 9 - map ctrl+alt+0 goto_tab 10 - - map ctrl+shift+equal change_font_size all +1.0 - map ctrl+shift+minus change_font_size all -1.0 - map ctrl+shift+backspace change_font_size all 0 - - map ctrl+shift+delete clear_terminal reset active -'' diff --git a/home/apps/virtmanager.nix b/home/apps/virtmanager.nix deleted file mode 100644 index cca4dd7..0000000 --- a/home/apps/virtmanager.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; let - cfg = config.local.apps.virtmanager; -in { - options.local.apps.virtmanager.enable = mkEnableOption "Virtmanager"; - config = mkIf cfg.enable { - home.packages = with pkgs; [ - virt-manager - ]; - }; -} diff --git a/home/cli.nix b/home/cli.nix deleted file mode 100644 index c2ac1f4..0000000 --- a/home/cli.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; { - programs = { - ## talvez esto debería moverse a base - zsh = { - enable = true; - syntaxHighlighting.enable = true; - initExtra = import ./zshrc.nix pkgs; - }; - git = { - enable = true; - userEmail = "fabian@posixlycorrect.com"; - userName = "Fabian Montero"; - signing = { - key = "7AA277E604A4173916BBB4E91FFAC35E1798174F"; - signByDefault = true; - }; - }; - gpg = { - enable = true; - settings = { - default-key = "7AA277E604A4173916BBB4E91FFAC35E1798174F"; - }; - }; - }; - - services.gpg-agent = { - enable = true; - enableZshIntegration = true; - pinentryPackage = pkgs.pinentry-emacs; - }; - - home.packages = with pkgs; [ - calc - file - gcc - htop - killall - man-pages - man-pages-posix - neovim - rar - tree - units - unzip - usbutils - zip - ]; -} diff --git a/home/default.nix b/home/default.nix deleted file mode 100644 index 03fef94..0000000 --- a/home/default.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ - self, - nixpkgs, - unstable, - hm-isolation, - nixGL, -}: { - config, - pkgs, - lib, - ... -}: -with lib; { - imports = [ - (hm-isolation.homeManagerModule) - ./accounts.nix - ./apps - ./allowUnfreeWhitelist.nix - ./gui - ./isolation.nix - ./options.nix - ./cli.nix - ./systemd - ]; - - nixpkgs.overlays = [self.overlay nixGL.overlay]; - - services.ssh-agent.enable = true; - - home = { - stateVersion = "21.11"; # No tocar esto - username = "fabian"; - homeDirectory = "/home/fabian"; - sessionVariables = { - "EDITOR" = "nvim"; - "TERMINAL" = "kitty"; - }; - keyboard = { - layout = "us"; - variant = "altgr-intl"; - }; - }; - - xdg.enable = true; - - nix.registry = { - "system".to = { - type = "path"; - path = "/home/fabian/nix"; - }; - - "nixpkgs".flake = nixpkgs; - "unstable".flake = unstable; - }; - - programs.home-manager.enable = true; - - local = { - apps.enable = mkDefault (!config.home.isolation.active); - - gui = { - enable = mkDefault true; - desktop = mkDefault (!config.home.isolation.active); - }; - }; -} diff --git a/home/gui/autorandr.nix b/home/gui/autorandr.nix deleted file mode 100644 index c01ffe1..0000000 --- a/home/gui/autorandr.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -with lib; let - cfg = config.local.gui.autorandr; -in { - options.local.gui.autorandr.enable = mkEnableOption "Autorandr"; - config = mkIf cfg.enable { - programs.autorandr = { - enable = true; - profiles."${config.local.platform}" = config.local.display.autorandrProfile; - }; - }; -} diff --git a/home/gui/default.nix b/home/gui/default.nix deleted file mode 100644 index 1b297a3..0000000 --- a/home/gui/default.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -with lib; let - cfg = config.local.gui; -in { - options.local.gui = { - enable = mkEnableOption "GUI settings and programs"; - desktop = mkEnableOption "i3 desktop envirorment"; - }; - - imports = [ - ./autorandr.nix - ./fonts.nix - ./gtk.nix - ./i3.nix - ./polybar.nix - ./startx.nix - ]; - - config = mkIf cfg.enable { - local.gui = { - fonts.enable = mkDefault true; - gtk.enable = mkDefault true; - - autorandr.enable = mkDefault cfg.desktop; - i3.enable = mkDefault cfg.desktop; - polybar.enable = mkDefault cfg.desktop; - startx.enable = mkDefault cfg.desktop; - }; - - services = mkIf cfg.desktop { - picom = { - enable = true; - }; - - dunst = { - enable = true; - }; - - betterlockscreen = { - enable = true; - }; - }; - - xdg.mimeApps.enable = true; - }; -} diff --git a/home/gui/fonts.nix b/home/gui/fonts.nix deleted file mode 100644 index 7c38dbe..0000000 --- a/home/gui/fonts.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -with lib; let - cfg = config.local.gui.fonts; -in { - options.local.gui.fonts.enable = mkEnableOption "Font management"; - config = mkIf cfg.enable { - fonts.fontconfig.enable = true; - - home.packages = with pkgs; [ - jetbrains-mono - ]; - }; -} diff --git a/home/gui/gtk.nix b/home/gui/gtk.nix deleted file mode 100644 index 0f14af6..0000000 --- a/home/gui/gtk.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; let - cfg = config.local.gui.gtk; -in { - options.local.gui.gtk.enable = mkEnableOption "GTK related programs"; - config = mkIf cfg.enable { - home.packages = with pkgs; [ - gruvbox-dark-icons-gtk - libsForQt5.breeze-gtk - ]; - }; -} diff --git a/home/gui/i3.nix b/home/gui/i3.nix deleted file mode 100644 index 687d6c6..0000000 --- a/home/gui/i3.nix +++ /dev/null @@ -1,110 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -with lib; let - cfg = config.local.gui.i3; -in { - options.local.gui.i3.enable = mkEnableOption "i3 window manager"; - config = mkIf cfg.enable { - xsession.windowManager.i3 = { - enable = true; - package = pkgs.i3-gaps; - - config = let - mod = "Mod4"; - in { - modifier = mod; - # revisar luego si config.bars tiene un default danino - - fonts = { - names = ["JetBrains Mono"]; - style = "Regular"; - size = 8.0; - }; - - gaps = { - inner = 10; - outer = -10; - }; - - window = { - hideEdgeBorders = "both"; - }; - - colors = { - focused = { - background = "#222222"; - border = "#4c7899"; - childBorder = "#222222"; - indicator = "#292d2e"; - text = "#888888"; - }; - }; - - # mkOptionDefault hace que se ponga la config por default - # y se sobreescriba las cosas que pongo acA - # NO QUITARLO. ver man home-configuration.nix - keybindings = mkOptionDefault { - "${mod}+Return" = "exec ${pkgs.kitty}/bin/kitty ${pkgs.tmux}/bin/tmux"; - "${mod}+Tab" = "focus right"; - "${mod}+Shift+Tab" = "focus left"; - "${mod}+Shift+s" = "exec ${pkgs.maim}/bin/maim -s -u | ${pkgs.xclip}/bin/xclip -selection clipboard -t image/png -i"; - "${mod}+Shift+w" = "move workspace to output right"; - "${mod}+l" = "exec ${pkgs.betterlockscreen}/bin/betterlockscreen -l"; - }; - - startup = [ - { - command = "${pkgs.xss-lock}/bin/xss-lock --transfer-sleep-lock -- ${pkgs.i3lock}/bin/i3lock --nofork"; - notification = false; - } - { - command = "${pkgs.networkmanagerapplet}/bin/nm-applet"; - notification = false; - } - { - command = "${pkgs.feh}/bin/feh --bg-fill ${config.home.homeDirectory}/Pictures/wallpapers/jupiter.png"; - notification = false; - always = true; - } - { - command = "${pkgs.i3-gaps}/bin/i3-msg 'workspace 1; exec ${pkgs.firefox}/bin/firefox'"; - } - { - command = "${pkgs.i3-gaps}/bin/i3-msg 'workspace 2; exec ${pkgs.tdesktop}/bin/telegram-desktop'"; - } - #{ - # command = "${pkgs.i3-gaps}/bin/i3-msg 'workspace 2; exec ${pkgs.element-desktop}/bin/element-desktop'"; - #} - { - command = "${pkgs.systemd}/bin/systemctl --user restart polybar.service"; - notification = false; - always = true; - } - { - command = "${pkgs.autorandr}/bin/autorandr -c"; - notification = false; - always = true; - } - ]; - - workspaceOutputAssign = - [ - { - output = config.local.display."0"; - workspace = "1"; - } - ] - ++ optional (config.local.display."1" != null) { - output = config.local.display."1"; - workspace = "10"; - }; - - bars = []; - }; - }; - }; -} diff --git a/home/gui/polybar.nix b/home/gui/polybar.nix deleted file mode 100644 index 042c668..0000000 --- a/home/gui/polybar.nix +++ /dev/null @@ -1,464 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -with lib; let - cfg = config.local.gui.polybar; -in { - options.local.gui.polybar.enable = mkEnableOption "Polybar"; - config = mkIf cfg.enable { - services.polybar = mkIf (!config.home.isolation.active) { - enable = true; - package = pkgs.polybarFull; - script = '' - # Terminate already running bar instances - killall -q polybar - - # Wait until the processes have been shut down - while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done - - # Launch Polybar, using default config location ~/.config/polybar/config - polybar -r main & polybar -r secondary & - ''; - - settings = { - "colors" = { - # background = "\${xrdb:color0:#222}"; - background = "#AA000000"; - background-alt = "#00000000"; - # foreground = "\${xrdb:color7:#222}"; - foreground = "#ffffff"; - foreground-alt = "#ffffff"; - primary = "#ffffff"; - secondary = "#e60053"; - alert = "#bd2c40"; - }; - - "bar/main" = { - monitor = "${config.local.display."0"}"; - width = "100%"; - height = 30; - offset-x = "0%"; - offset-y = "0%"; - radius = 0.0; - fixed-center = false; - - background = "\${colors.background}"; - foreground = "\${colors.foreground}"; - - line-size = 1; - line-color = "#f0000000"; - - border-size = 0; - border-color = "#00000000"; - - padding-left = 0; - padding-right = 0; - - module-margin-left = 1; - module-margin-right = 1; - - # font-0 = "fixed:pixelsize=10;1"; - font-0 = "JetBrains Mono Light:size=10;0"; - font-1 = "unifont:fontformat=truetype:size=8:antialias=false;0"; - font-2 = "siji:pixelsize=10;1"; - # font-2 = "FontAwesome5Free:style=Regular:size=10;4"; - - modules-left = "i3"; - modules-center = "xwindow"; - modules-right = "xkeyboard pulseaudio filesystem memory cpu temperature gputemperature nvmetemperature wlan eth date semanatec"; - separator = "|"; - - tray-position = "right"; - tray-padding = 2; - - # To allow other windows to be placed above the bar, or to avoid having the bar visible when in fullscreen mode, - # you need to use the following two parameters. Note that it will tell the window manager to back off so no - # area will be reserved, etc. - # - # wm-restack = "i3"; - # override-redirect = true; - - cursor-click = "pointer"; - cursor-scroll = "ns-resize"; - }; - - "bar/secondary" = optionalAttrs (config.local.display."1" != null) { - monitor = "${config.local.display."1"}"; - "inherit" = "bar/main"; - - modules-left = "i3"; - modules-center = "xwindow"; - modules-right = "xkeyboard pulseaudio date"; - tray-position = "none"; - }; - - "module/xwindow" = { - type = "internal/xwindow"; - label = "%title:0:30:...%"; - }; - - "module/xkeyboard" = { - type = "internal/xkeyboard"; - blacklist-0 = "num lock"; - - format-prefix = ""; - format-prefix-foreground = "\${colors.foreground-alt}"; - - label-layout = "%layout%"; - - label-indicator-padding = 2; - label-indicator-margin = 1; - label-indicator-background = "\${colors.secondary}"; - }; - - "module/filesystem" = { - type = "internal/fs"; - interval = 10; - - mount-0 = "/"; - - label-mounted = "%{F#0a81f5}%mountpoint%%{F-}: %used%/%total%"; - label-unmounted = ""; - }; - - "module/i3" = { - type = "internal/i3"; - format = " "; - index-sort = true; - wrapping-scroll = false; - - # Only show workspaces on the same output as the bar - # pin-workspaces = true - - label-mode-padding = 1; - label-mode-foreground = "#000"; - label-mode-background = "\${colors.primary}"; - - # focused = Active workspace on focused monitor - label-focused = "%index%"; - label-focused-background = "\${colors.background}"; - label-focused-underline = "\${colors.primary}"; - label-focused-padding = 1; - - # unfocused = Inactive workspace on any monitor - label-unfocused = "%index%"; - label-unfocused-padding = 1; - - # visible = Active workspace on unfocused monitor - label-visible = "%index%"; - label-visible-background = "\${self.label-focused-background}"; - label-visible-underline = "\${self.label-focused-underline}"; - label-visible-padding = "\${self.label-focused-padding}"; - - # urgent = Workspace with urgency hint set - label-urgent = "%index%"; - label-urgent-background = "\${colors.alert}"; - label-urgent-padding = 1; - }; - - "module/xbacklight" = { - type = "internal/xbacklight"; - - format = "