summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exwm.nix25
-rw-r--r--flake.lock217
-rw-r--r--flake.nix62
-rw-r--r--hosts/hanekawa/configuration.nix107
-rw-r--r--hosts/hanekawa/hardware-configuration.nix77
-rw-r--r--hosts/kunagisa/configuration.nix86
-rw-r--r--hosts/kunagisa/hardware-configuration.nix39
-rw-r--r--hosts/larissa/configuration.nix21
-rw-r--r--modules/emacs/README.org447
-rw-r--r--modules/emacs/emacs.nix48
-rw-r--r--modules/emacs/org.nix11
-rw-r--r--modules/gnome-config.nix57
-rw-r--r--modules/gnome.nix63
-rw-r--r--modules/s3nixcache-mixrank.nix13
-rw-r--r--secrets/authinfo.age12
-rw-r--r--secrets/personal-mail.age9
-rw-r--r--secrets/secrets.nix12
-rw-r--r--secrets/university-mail.age9
-rw-r--r--secrets/work-mail.age10
-rw-r--r--users/leonardo.nix240
-rw-r--r--wallpaper.pngbin0 -> 3575406 bytes
21 files changed, 1565 insertions, 0 deletions
diff --git a/exwm.nix b/exwm.nix
new file mode 100644
index 0000000..df8e306
--- /dev/null
+++ b/exwm.nix
@@ -0,0 +1,25 @@
+{pkgs, inputs, system, ...}:
+{
+ services.xserver = {
+ enable = true;
+ updateDbusEnvironment = true;
+ windowManager.session = pkgs.lib.singleton {
+ name = "exwm";
+ start = ''
+ dbus-launch ${inputs.emacs.packages.x86_64-linux.default}/bin/emacs -mm
+ '';
+ };
+ desktopManager = {
+ default = "none";
+ };
+ displayManager = {
+ lightdm = {
+ enable = true;
+ };
+ autoLogin = {
+ enable = true;
+ user = "leonardo";
+ };
+ };
+ };
+}
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..85fa14a
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,217 @@
+{
+ "nodes": {
+ "agenix": {
+ "inputs": {
+ "darwin": "darwin",
+ "home-manager": [
+ "home-manager"
+ ],
+ "nixpkgs": [
+ "nixpkgs"
+ ],
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1707830867,
+ "narHash": "sha256-PAdwm5QqdlwIqGrfzzvzZubM+FXtilekQ/FA0cI49/o=",
+ "owner": "ryantm",
+ "repo": "agenix",
+ "rev": "8cb01a0e717311680e0cbca06a76cbceba6f3ed6",
+ "type": "github"
+ },
+ "original": {
+ "owner": "ryantm",
+ "repo": "agenix",
+ "type": "github"
+ }
+ },
+ "darwin": {
+ "inputs": {
+ "nixpkgs": [
+ "agenix",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1700795494,
+ "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=",
+ "owner": "lnl7",
+ "repo": "nix-darwin",
+ "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d",
+ "type": "github"
+ },
+ "original": {
+ "owner": "lnl7",
+ "ref": "master",
+ "repo": "nix-darwin",
+ "type": "github"
+ }
+ },
+ "emacs-overlay": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": [
+ "nixpkgs"
+ ],
+ "nixpkgs-stable": "nixpkgs-stable"
+ },
+ "locked": {
+ "lastModified": 1710263223,
+ "narHash": "sha256-Z19hPhLUwF5M8FQdBuSH+/GDCdWzr5FPDHN+Cbk1/0Q=",
+ "owner": "nix-community",
+ "repo": "emacs-overlay",
+ "rev": "383aeb1bf3e2fdf14e7b1b66a35123228d7a0edb",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "emacs-overlay",
+ "type": "github"
+ }
+ },
+ "firefox-gnome-theme": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1708965002,
+ "narHash": "sha256-gIBZCPB0sA8Gagrxd8w4+y9uUkWBnXJBmq9Ur5BYTQU=",
+ "owner": "rafaelmardojai",
+ "repo": "firefox-gnome-theme",
+ "rev": "4e966509c180f93ba8665cd73cad8456bf44baab",
+ "type": "github"
+ },
+ "original": {
+ "owner": "rafaelmardojai",
+ "repo": "firefox-gnome-theme",
+ "type": "github"
+ }
+ },
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems_2"
+ },
+ "locked": {
+ "lastModified": 1710146030,
+ "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "from-elisp": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1694631482,
+ "narHash": "sha256-fTdDUf+ITtLK/zHWDa5RCZdUj1qT/carlHrHVPuUxlo=",
+ "owner": "o-santi",
+ "repo": "from-elisp",
+ "rev": "3177e75d727232a9301822742f4d0bd23bb277c6",
+ "type": "github"
+ },
+ "original": {
+ "owner": "o-santi",
+ "repo": "from-elisp",
+ "type": "github"
+ }
+ },
+ "home-manager": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1710164657,
+ "narHash": "sha256-l64+ZjaQAVkHDVaK0VHwtXBdjcBD6nLBD+p7IfyBp/w=",
+ "owner": "nix-community",
+ "repo": "home-manager",
+ "rev": "017b12de5b899ef9b64e2c035ce257bfe95b8ae2",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "home-manager",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1709961763,
+ "narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nixpkgs-stable": {
+ "locked": {
+ "lastModified": 1710162809,
+ "narHash": "sha256-i2R2bcnQp+85de67yjgZVvJhd6rRnJbSYNpGmB6Leb8=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "ddcd7598b2184008c97e6c9c6a21c5f37590b8d2",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-23.11",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "agenix": "agenix",
+ "emacs-overlay": "emacs-overlay",
+ "firefox-gnome-theme": "firefox-gnome-theme",
+ "from-elisp": "from-elisp",
+ "home-manager": "home-manager",
+ "nixpkgs": "nixpkgs"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ },
+ "systems_2": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..18a161b
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,62 @@
+{
+ description = "My personal devices' flake modules";
+
+ nixConfig = {
+ extra-substituters = [
+ "https://nix-community.cachix.org"
+ "s3://mr-nixcache-icenyeamyubu?profile=mixrank"
+ ];
+ extra-trusted-public-keys = [
+ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
+ "mr-nixcache-icenyeamyubu:q2ulb+bD5NCbp9nvvHod39/1qNqnYX0ACb8eQckb7pI="
+ ];
+ };
+
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
+ home-manager = {
+ url = "github:nix-community/home-manager";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ agenix = {
+ url = "github:ryantm/agenix";
+ inputs.nixpkgs.follows = "nixpkgs";
+ inputs.home-manager.follows = "home-manager";
+ };
+ emacs-overlay = {
+ url = "github:nix-community/emacs-overlay";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ from-elisp = {
+ url = "github:o-santi/from-elisp";
+ flake = false;
+ };
+ firefox-gnome-theme = {
+ url = "github:rafaelmardojai/firefox-gnome-theme";
+ flake = false;
+ };
+ };
+
+ outputs = { self, nixpkgs, home-manager, agenix, ... } @ inputs :
+ let
+ system = "x86_64-linux";
+ hosts = [
+ "hanekawa" # notebook
+ "kunagisa" # workstation
+ ];
+ defaultNixosSystem = host: nixpkgs.lib.nixosSystem {
+ inherit system;
+ specialArgs = { inherit inputs; };
+ modules = [
+ ./hosts/${host}/configuration.nix
+ ./users/leonardo.nix
+ home-manager.nixosModules.home-manager
+ agenix.nixosModules.default
+ ];
+ };
+ in {
+ nixosConfigurations = builtins.listToAttrs
+ (map (host: {name = host; value = defaultNixosSystem host; }) hosts)
+ ;
+ };
+}
diff --git a/hosts/hanekawa/configuration.nix b/hosts/hanekawa/configuration.nix
new file mode 100644
index 0000000..295b31f
--- /dev/null
+++ b/hosts/hanekawa/configuration.nix
@@ -0,0 +1,107 @@
+# 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, lib, inputs, ... }:
+
+{
+ imports =
+ [ # Include the results of the hardware scan.
+ ./hardware-configuration.nix
+ ];
+
+ # Bootloader.
+ boot.loader.systemd-boot.enable = true;
+ boot.loader.efi.canTouchEfiVariables = true;
+
+ networking.hostName = "hanekawa"; # Define your hostname.
+ # Configure network proxy if necessary
+ # networking.proxy.default = "http://user:password@proxy:port/";
+ # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
+
+ # Enable networking
+ networking.networkmanager.enable = true;
+
+ # Set your time zone.
+ time.timeZone = "America/Sao_Paulo";
+
+ # Select internationalisation properties.
+ i18n.defaultLocale = "pt_BR.UTF-8";
+
+ # Enable the X11 windowing system.
+ services.xserver = {
+ enable = true;
+ layout = "br";
+ xkbVariant = "";
+ libinput = {
+ enable = true;
+ touchpad = {
+ tapping = true;
+ clickMethod = "clickfinger";
+ tappingButtonMap = "lrm";
+ };
+ };
+ videoDrivers = [ "nvidia" ];
+ };
+
+ # Configure console keymap
+ console.keyMap = "br-abnt2";
+
+ # Enable CUPS to print documents.
+ services.printing.enable = true;
+
+ services.thermald.enable = true;
+
+ # Enable sound with pipewire.
+ sound.enable = true;
+
+ security.rtkit.enable = true;
+ services.fstrim.enable = lib.mkDefault true;
+ services.pipewire = {
+ enable = true;
+ alsa.enable = true;
+ alsa.support32Bit = true;
+ pulse.enable = true;
+ # If you want to use JACK applications, uncomment this
+ #jack.enable = true;
+
+ # use the example session manager (no others are packaged yet so this is enabled by default,
+ # no need to redefine it in your config for now)
+ #media-session.enable = true;
+ };
+
+ # Define a user account. Don't forget to set a password with ‘passwd’.
+ users.users.leonardo = {
+ isNormalUser = true;
+ initialPassword = "";
+ description = "leonardo";
+ extraGroups = [ "networkmanager" "wheel" ];
+ };
+
+ fonts = {
+ fontconfig.enable = true;
+ packages = [(pkgs.nerdfonts.override { fonts = [ "Iosevka" "FiraCode" ]; })];
+ };
+
+ # Allow unfree packages
+ services.openssh.enable = true;
+ programs.ssh = {
+ forwardX11 = true;
+ startAgent = true;
+ };
+
+ # Open ports in the firewall.
+ # networking.firewall.allowedTCPPorts = [ ... ];
+ # networking.firewall.allowedUDPPorts = [ ... ];
+ # Or disable the firewall altogether.
+ # networking.firewall.enable = false;
+
+ # This value determines the NixOS release from which the default
+ # settings for stateful data, like file locations and database versions
+ # on your system were taken. It‘s perfectly fine and recommended to leave
+ # this value at the release version of the first install of this system.
+ # Before changing this value read the documentation for this option
+ # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
+ system.stateVersion = "23.05"; # Did you read the comment?
+
+}
diff --git a/hosts/hanekawa/hardware-configuration.nix b/hosts/hanekawa/hardware-configuration.nix
new file mode 100644
index 0000000..2b11bd6
--- /dev/null
+++ b/hosts/hanekawa/hardware-configuration.nix
@@ -0,0 +1,77 @@
+# 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" "nvme" "usb_storage" "sd_mod" ];
+ boot.initrd.kernelModules = [ ];
+
+ boot.kernelModules = [
+ "kvm-intel"
+ "i915"
+ ];
+ boot.kernelParams = [
+ "acpi_osi=Linux-Dell-Video"
+ ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "/dev/disk/by-uuid/36536f52-8ca1-4a1e-b418-4016e529ea97";
+ fsType = "ext4";
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/6021-0AF8";
+ fsType = "vfat";
+ };
+
+ swapDevices =
+ [ { device = "/dev/disk/by-uuid/51402149-30c4-475c-af19-c5d600b1ee8e"; }
+ ];
+
+
+
+ hardware = {
+ opengl = {
+ enable = true;
+ driSupport = true;
+ driSupport32Bit = true;
+ };
+ pulseaudio.enable = false;
+ nvidia = {
+ modesetting.enable = true;
+ powerManagement = { enable = false; finegrained = false; };
+ open = false;
+ nvidiaSettings = true;
+ prime = {
+ offload = {
+ enable = true;
+ enableOffloadCmd = true;
+ };
+ sync.enable = false;
+ reverseSync.enable = false;
+ intelBusId = "PCI:0:2:0";
+ nvidiaBusId = "PCI:1:0:0";
+ };
+ };
+ opengl.extraPackages = [ pkgs.vaapiVdpau ];
+
+ };
+
+ # 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
+ # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
+ networking.useDHCP = lib.mkDefault true;
+ # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true;
+ # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true;
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
+ hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/hosts/kunagisa/configuration.nix b/hosts/kunagisa/configuration.nix
new file mode 100644
index 0000000..b9b669a
--- /dev/null
+++ b/hosts/kunagisa/configuration.nix
@@ -0,0 +1,86 @@
+# 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, inputs, ... }:
+
+{
+ imports =
+ [ # Include the results of the hardware scan.
+ ./hardware-configuration.nix
+ ];
+
+ # Bootloader.
+ boot.loader.systemd-boot.enable = true;
+ boot.loader.efi.canTouchEfiVariables = true;
+ boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
+
+ networking.hostName = "kunagisa"; # Define your hostname.
+ # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
+
+ # Configure network proxy if necessary
+ # networking.proxy.default = "http://user:password@proxy:port/";
+ # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
+
+ # Enable networking
+ networking.networkmanager.enable = true;
+
+ # Set your time zone.
+ time.timeZone = "America/Sao_Paulo";
+
+ # Select internationalisation properties.
+ i18n.defaultLocale = "pt_BR.UTF-8";
+
+ # Enable the X11 windowing system.
+ services.xserver = {
+ enable = true;
+ xkb = {
+ variant = "";
+ layout = "br";
+ };
+ };
+
+ # Configure console keymap
+ console.keyMap = "br-abnt2";
+
+ # Enable CUPS to print documents.
+ services.printing.enable = true;
+
+ # Enable sound with pipewire.
+ sound.enable = true;
+ hardware.pulseaudio.enable = false;
+ security.rtkit.enable = true;
+ services.pipewire = {
+ enable = true;
+ alsa.enable = true;
+ alsa.support32Bit = true;
+ pulse.enable = true;
+ # If you want to use JACK applications, uncomment this
+ #jack.enable = true;
+
+ # use the example session manager (no others are packaged yet so this is enabled by default,
+ # no need to redefine it in your config for now)
+ #media-session.enable = true;
+ };
+
+ # Enable touchpad support (enabled default in most desktopManager).
+ # services.xserver.libinput.enable = true;
+
+ # Open ports in the firewall.
+ # networking.firewall.allowedTCPPorts = [ ... ];
+ # networking.firewall.allowedUDPPorts = [ ... ];
+ # Or disable the firewall altogether.
+ # networking.firewall.enable = false;
+ networking.firewall = {
+ enable = false;
+ # allowedTCPPorts = [ 12345 ];
+ };
+
+ # This value determines the NixOS release from which the default
+ # settings for stateful data, like file locations and database versions
+ # on your system were taken. It‘s perfectly fine and recommended to leave
+ # this value at the release version of the first install of this system.
+ # Before changing this value read the documentation for this option
+ # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
+ system.stateVersion = "23.05"; # Did you read the comment?
+}
diff --git a/hosts/kunagisa/hardware-configuration.nix b/hosts/kunagisa/hardware-configuration.nix
new file mode 100644
index 0000000..6e353af
--- /dev/null
+++ b/hosts/kunagisa/hardware-configuration.nix
@@ -0,0 +1,39 @@
+# 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" "usbhid" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-amd" ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "/dev/disk/by-uuid/96c114a2-ffd7-476d-80fa-51e670c27e4b";
+ fsType = "ext4";
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/AA22-4A81";
+ fsType = "vfat";
+ };
+
+ swapDevices =
+ [ { device = "/dev/disk/by-uuid/1a204e5c-05cb-4e7f-b859-927fb024fb12"; }
+ ];
+
+ # 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
+ # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
+ networking.useDHCP = lib.mkDefault true;
+ # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/hosts/larissa/configuration.nix b/hosts/larissa/configuration.nix
new file mode 100644
index 0000000..b007ebd
--- /dev/null
+++ b/hosts/larissa/configuration.nix
@@ -0,0 +1,21 @@
+{ config, pkgs, lib, ... }:
+{
+ imports =
+ [
+ <nixos-hardware/raspberry-pi/4>
+ ./hardware-configuration.nix
+ ];
+ hardware = {
+ raspberry-pi."4".apply-overlays-dtmerge.enable = true;
+ deviceTree = {
+ enable = true;
+ filter = "*rpi-4-*.dtb";
+ };
+ };
+ console.enable = false;
+ environment.systemPackages = with pkgs; [
+ libraspberrypi
+ raspberrypi-eeprom
+ ];
+ system.stateVersion = "23.11";
+}
diff --git a/modules/emacs/README.org b/modules/emacs/README.org
new file mode 100644
index 0000000..ff1254b
--- /dev/null
+++ b/modules/emacs/README.org
@@ -0,0 +1,447 @@
+#+TITLE: My emacs literate configuration
+#+AUTHOR: Leonardo Santiago
+
+This org file is used as the configuration source for my emacs. Additional packages may be found at emacs.nix (those that cannot be directly installed from =use-package=). Though declared in emacs lisp, they actually are completely managed by the =nix= package manager, by parsing the declarations on this file and using them to fetch the packages, which I think is really cool.
+
+This makes it such that it is trivial to handle complex configurations, such as pylsp with plugins or treesitter grammars installation process (which usually envolves some stateful installations outside of emacs).
+
+In order to run this emacs configuration locally, all you need to do is run the following command:
+#+begin_src shell
+nix run github:o-santi/emacs --experimental-features "nix-command" --experimental-features "flakes"
+#+end_src
+Though you probably shouldn't, because it will most likely build all of emacs from scratch (which takes a little while).
+
+You can also use it as a ~nixosModule~, in order to add additional packages like fonts.
+
+* Core
+** Remove bar mode
+#+begin_src emacs-lisp :tangle yes
+(menu-bar-mode -1)
+(tool-bar-mode -1)
+
+(setq use-short-answers t)
+
+(setq ring-bell-function 'ignore)
+(setq-default indent-tabs-mode nil)
+#+end_src
+
+** Theme and font
+#+begin_src emacs-lisp :tangle yes
+(use-package modus-themes)
+(use-package kanagawa-theme)
+(load-theme 'kanagawa t)
+
+(set-face-attribute 'default nil
+ :family "Iosevka Nerd Font"
+ :width 'normal
+ :weight 'normal)
+#+end_src
+
+** Backups
+#+begin_src emacs-lisp :tangle yes
+(setq
+ backup-by-copying t ; don't clobber symlinks
+ backup-directory-alist '(("." . "~/.saves/")) ; don't litter my fs tree
+ delete-old-versions t
+ kept-new-versions 6
+ kept-old-versions 2
+ version-control t)
+#+end_src
+
+** Background opacity
+Remove background on terminal, and add transparency on GUI
+#+begin_src emacs-lisp :tangle yes
+(defun on-after-init ()
+ (unless (display-graphic-p (selected-frame))
+ (set-face-background 'default "unspecified-bg" (selected-frame))))
+
+(add-hook 'window-setup-hook 'on-after-init)
+(set-frame-parameter nil 'alpha-background 70)
+(add-to-list 'default-frame-alist '(alpha-background . 70))
+#+end_src
+
+* Utility
+** All the Icons
+Works through nixosModules.
+#+begin_src emacs-lisp :tangle yes
+(use-package all-the-icons
+ :if (display-graphic-p))
+
+(use-package all-the-icons-completion
+ :if (display-graphic-p)
+ :after all-the-icons
+ :hook (marginalia-mode . all-the-icons-completion-mode))
+#+end_src
+** Direnv
+To integrate with nix shells.
+#+begin_src emacs-lisp :tangle yes
+(use-package envrc
+ :config (envrc-global-mode))
+#+end_src
+** Magit
+Configurations for magit
+*** Use Magit
+#+begin_src emacs-lisp :tangle yes
+(use-package magit
+ :custom (magit-process-finish-apply-ansi-colors t))
+#+end_src
+
+*** Forge
+#+begin_src emacs-lisp :tangle yes
+(setq auth-sources '("/run/agenix/authinfo"))
+#+end_src
+To interact with gitlab and github.
+#+begin_src emacs-lisp :tangle yes
+(use-package forge
+ :after magit)
+#+end_src
+
+** Vertico, Orderless, Marginalia
+Pretty minibuffer support
+#+begin_src emacs-lisp :tangle yes
+ (use-package vertico
+ :config (vertico-mode))
+
+ (use-package orderless
+ :custom
+ (completion-styles '(orderless basic))
+ (completion-category-defaults nil)
+ (completion-category-overrides '((file (styles basic partial-completion)))))
+
+ (use-package marginalia
+ :config (marginalia-mode))
+
+ (use-package ctrlf
+ :config (ctrlf-mode +1))
+#+end_src
+** Projects
+#+begin_src emacs-lisp :tangle yes
+ (defcustom project-root-markers
+ '("Cargo.toml" "flake.nix" ".git")
+ "Files that indicate that directory is the root of a project"
+ :type '(repeat string)
+ :group 'project)
+
+ (defun project-root-p (path)
+ (catch 'found
+ (dolist (marker project-root-markers)
+ (when (file-exists-p (concat path marker))
+ (throw 'found marker)))))
+
+ (defun project-find-root (path)
+ "Search up the PATH for `project-root-markers'."
+ (let ((path (expand-file-name path)))
+ (catch 'found
+ (while (not (equal "/" path))
+ (if (not (project-root-p path))
+ (setq path (file-name-directory (directory-file-name path)))
+ (throw 'found (cons 'transient path)))))))
+
+ (use-package project
+ :config (setq project-find-functions '(project-find-root)))
+#+end_src
+** Helpful and which key
+Better help defaults
+#+begin_src emacs-lisp :tangle yes
+(use-package helpful
+ :config
+ (global-set-key (kbd "C-h f") #'helpful-callable)
+ (global-set-key (kbd "C-h v") #'helpful-variable)
+ (global-set-key (kbd "C-h x") #'helpful-command)
+ (global-set-key (kbd "C-h k") #'helpful-key))
+
+(use-package which-key
+ :config (which-key-mode))
+#+end_src
+** Dired
+I wanna try some QoL addons for dired.
+#+begin_src emacs-lisp :tangle yes
+(use-package dired
+ :hook (dired-mode . dired-hide-details-mode))
+(use-package dired-subtree
+ :after dired
+ :config
+ (add-hook 'dired-mode-hook
+ (lambda () (local-set-key (kbd "<tab>") #'dired-subtree-toggle))))
+
+(use-package all-the-icons-dired
+ :hook (dired-mode . all-the-icons-dired-mode))
+#+end_src
+** Windows
+I wanna test out =winner-mode=
+#+begin_src emacs-lisp :tangle yes
+(use-package winner
+ :config (winner-mode))
+#+end_src
+** Bind key
+#+begin_src emacs-lisp :tangle yes
+(use-package bind-key)
+#+end_src
+** Eglot
+Language server support. Already comes installed but used to configure additional language servers.
+#+begin_src emacs-lisp :tangle yes
+(use-package eglot
+ :config (add-to-list 'eglot-server-programs '(nix-mode . ("nil"))))
+#+end_src
+
+** Corfu
+Completion popup system
+#+begin_src emacs-lisp :tangle yes
+(use-package corfu
+ :config (global-corfu-mode)
+ :custom
+ (corfu-auto t)
+ (corfu-cycle t)
+ (corfu-separator ?\s)
+ (corfu-quit-no-match t))
+#+end_src
+** Vterm
+#+begin_src emacs-lisp :tangle yes
+(use-package vterm)
+#+end_src
+** Compilation
+Add support for ansi escape codes in compilation
+#+begin_src emacs-lisp :tangle yes
+(use-package xterm-color
+ :custom (compilation-environment '("TERM=xterm-256color")))
+(defun my/advice-compilation-filter (f proc string)
+ (funcall f proc (xterm-color-filter string)))
+(advice-add 'compilation-filter :around #'my/advice-compilation-filter)
+#+end_src
+
+** Pdf reader
+#+begin_src emacs-lisp :tangle yes
+(use-package pdf-tools
+ :defer t
+ :mode ("\\.pdf\\'" . pdf-view-mode)
+ :magic ("%PDF" . pdf-view-mode))
+#+end_src
+** View Large Files
+Minor mode to allow opening files in chunks
+#+begin_src emacs-lisp :tangle yes
+(use-package vlf
+ :config
+ (require 'vlf-setup)
+ (custom-set-variables
+ '(vlf-application 'dont-ask)))
+#+end_src
+* Languages
+I try to mostly use the new Treesitter modes, which comes builtin with the new emacs 29.
+** Python
+The package already comes builtin, so we only instantiate it to define the hooks and remap the default package for the new one.
+
+It also relies on python lsp server with builtin ruff support.
+#+begin_src emacs-lisp :tangle yes
+(add-to-list 'major-mode-remap-alist '(python-mode . python-ts-mode))
+(add-hook 'python-ts-mode-hook #'eglot-ensure)
+#+end_src
+
+** Nix
+#+begin_src emacs-lisp :tangle yes
+(use-package nix-mode
+ :hook (nix-mode . eglot-ensure))
+#+end_src
+** Rust
+Try to use the package.
+#+begin_src emacs-lisp :tangle yes
+(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-ts-mode))
+(add-hook 'rust-ts-mode-hook #'eglot-ensure)
+
+(setq rust-ts-mode-indent-offset 2)
+#+end_src
+
+** Markdown
+#+begin_src emacs-lisp :tangle yes
+(use-package markdown-mode
+ :mode "\\.md\\'")
+#+end_src
+* Personal
+** Org mode
+#+begin_src emacs-lisp :tangle yes
+(use-package org
+ :hook (org-mode . org-indent-mode)
+ :bind ("C-c a" . org-agenda)
+ :config
+ (custom-set-faces
+ '(org-headline-done
+ ((((class color) (min-colors 16) (background dark))
+ (:foreground "gray" :strike-through t)))))
+ :custom
+ (org-todo-keywords '((sequence "IDEA" "TODO" "STUCK" "DOING" "|" "DONE")
+ (sequence "ASSIGNED(a@!)" "WORKING(w!)" "ON REVIEW(r!)" "|" "MERGED(m!)" "CANCELLED(c!)")
+ (sequence "EVENT" "|" "FULFILLED")))
+ (org-startup-truncated nil)
+ (org-ellipsis "…")
+ (org-pretty-entities t)
+ (org-hide-emphasis-markers nil)
+ (org-fontify-quote-and-verse-blocks t)
+ (org-image-actual-width nil)
+ (org-indirect-buffer-display 'other-window)
+ (org-confirm-babel-evaluate nil)
+ (org-edit-src-content-indentation 0)
+ (org-auto-align-tags nil)
+ (org-fontify-done-headline t)
+ (org-agenda-files '("~/agenda.org")))
+#+end_src
+*** Org Modern
+#+begin_src emacs-lisp :tangle yes
+(defun bg (color)
+ `(:background ,color :inherit (org-todo org-modern-label) :foreground "gray25"))
+
+(use-package org-modern
+ :after org
+ :hook (org-mode . org-modern-mode)
+ :hook (org-agenda-finalize . org-modern-agenda)
+ :custom
+ (org-modern-todo-faces
+ `(("IDEA" . ,(bg "yellow"))
+ ("TODO" . org-modern-todo)
+ ("STUCK" . ,(bg "brown"))
+ ("DOING" . ,(bg "green"))
+ ("DONE" . org-modern-done)
+ ; work tasks
+ ("ASSIGNED" . org-modern-todo)
+ ("WORKING" . ,(bg "green yellow"))
+ ("ON REVIEW" . ,(bg "sandy brown"))
+ ("MERGED" . org-modern-done)
+ ("CANCELLED" . ,(bg "OrangeRed1"))
+ ; one time tasks
+ ("EVENT" . ,(bg "deep sky blue"))
+ ("DONE" . org-modern-done)))
+ (org-modern-priority t))
+#+end_src
+*** Org Agenda
+#+begin_src emacs-lisp :tangle yes
+(setq
+ org-agenda-window-setup 'current-window
+ org-agenda-restore-windows-after-quit t
+ org-agenda-skip-deadline-prewarning-if-scheduled t
+ org-agenda-compact-blocks t
+ org-agenda-span 'week
+ org-agenda-skip-deadline-if-done t
+ org-agenda-skip-scheduled-if-done t
+ org-agenda-skip-timestamp-if-done t
+ org-agenda-format-date "%e de %B, %A"
+ org-agenda-deadline-leaders '("Deadline: " "Daqui a %d dias:" "%d dias atrás")
+ org-agenda-scheduled-leaders '("Agendado: " "%d dias atrasado:")
+ )
+
+(setq
+ org-agenda-custom-commands
+ '(("w" "work"
+ ((todo "ASSIGNED")
+ (todo "WORKING")
+ (todo "ON REVIEW")
+ (tags-todo "CATEGORY=\"trabalho\"")))))
+#+end_src
+
+*** Org alert
+#+begin_src emacs-lisp :tangle yes
+(use-package org-alert
+ :ensure t
+ :config (org-alert-enable)
+ :custom
+ (org-alert-interval 60)
+ (org-alert-notify-cutoff 30)
+ (org-alert-notification-title "Emacs Agenda")
+ (alert-default-style 'notifications))
+#+end_src
+** Calendar
+try out emacs calfw
+#+begin_src emacs-lisp :tangle yes
+(use-package calfw)
+(use-package calfw-org
+ :bind ("C-c c l" . cfw:open-org-calendar)
+ :custom (cfw:org-overwrite-default-keybinding t))
+#+end_src
+** Email
+*** RSS feed reader
+#+begin_src emacs-lisp :tangle yes
+(use-package elfeed
+ :custom
+ (elfeed-feeds
+ '(("https://xeiaso.net/blog.rss" nixos)
+ ("https://smallcultfollowing.com/babysteps//atom.xml" rust)
+ ("https://fasterthanli.me/index.xml" rust nixos)
+ ("http://radar.spacebar.org/f/a/weblog/rss/1" tom7)
+ ("https://matklad.github.io/feed.xml" rust zig)
+ ("https://blog.m-ou.se/index.xml" rust)
+ ("https://without.boats/index.xml" rust)
+ )))
+
+#+end_src
+
+#+RESULTS:
+
+*** Mu4e
+**** Setting up mu4e.
+#+begin_src emacs-lisp :tangle yes
+(setq epg-pinentry-mode 'loopback)
+(setq user-mail-address "[email protected]")
+#+end_src
+Helper functions, to try to discover which mail pertains to which account.
+#+begin_src emacs-lisp :tangle yes
+(defun personal-p (msg)
+ (string-prefix-p "/personal/" (mu4e-message-field msg :maildir)))
+(defun university-p (msg)
+ (string-prefix-p "/university/" (mu4e-message-field msg :maildir)))
+(defun work-p (msg)
+ (string-prefix-p "/work/" (mu4e-message-field msg :maildir)))
+#+end_src
+Actual mu4e definition
+#+begin_src emacs-lisp :tangle yes
+(use-package mu4e
+ :bind ("C-c m" . mu4e)
+ :custom
+ (read-mail-command 'mu4e)
+ (mu4e-index-cleanup nil)
+ (mu4e-index-lazy-check t)
+ (mu4e-use-fancy-chars (display-graphic-p))
+ (mu4e-confirm-quit nil)
+ (mu4e-change-filenames-when-moving t)
+ (mu4e-update-interval (* 5 60))
+ (mu4e-get-mail-command "parallel mbsync ::: personal work university")
+ (mu4e-headers-fields
+ '((:human-date . 10)
+ (:flags . 6)
+ (:topic . 10)
+ (:from-or-to . 22)
+ (:subject . nil)))
+ (mu4e-drafts-folder (lambda (msg)
+ (cond
+ ((personal-p msg) "/personal/[Gmail]/Rascunhos")
+ ((university-p msg) "/university/[Gmail]/Rascunhos")
+ ((work-p msg) "/work/[Gmail]/Drafts"))))
+ (mu4e-sent-folder (lambda (msg)
+ (cond
+ ((personal-p msg) "/personal/[Gmail]/Enviados")
+ ((university-p msg) "/university/[Gmail]/Enviados")
+ ((work-p msg) "/work/[Gmail]/Sent"))))
+ (mu4e-refile-folder (lambda (msg)
+ (cond
+ ((personal-p msg) "/personal/[Gmail]/Todos\ os\ e-mails")
+ ((university-p msg) "/university/[Gmail]/Todos\ os\ e-mails")
+ ((work-p msg) "/work/[Gmail]/'All mail'"))))
+ (mu4e-trash-folder (lambda (msg)
+ (cond
+ ((personal-p msg) "/personal/[Gmail]/Lixeira")
+ ((university-p msg) "/university/[Gmail]/Lixeira")
+ ((work-p msg) "/work/[Gmail]/Trash"))))
+ :config
+ (add-to-list 'display-buffer-alist
+ `( ,(regexp-quote mu4e-main-buffer-name)
+ display-buffer-same-window)) ; to avoid opening in full frame everytime.
+ (add-to-list 'mu4e-bookmarks
+ '(:name "Inboxes"
+ :query "m:/personal/Inbox OR m:/work/Inbox OR m:/university/Inbox"
+ :key ?i))
+ (add-to-list 'mu4e-header-info-custom
+ '(:topic
+ :name "Topic"
+ :shortname "Topic"
+ :function (lambda (msg)
+ (cond
+ ((personal-p msg) "Personal")
+ ((university-p msg) "University")
+ ((work-p msg) "Work"))))))
+#+end_src
diff --git a/modules/emacs/emacs.nix b/modules/emacs/emacs.nix
new file mode 100644
index 0000000..14aadf2
--- /dev/null
+++ b/modules/emacs/emacs.nix
@@ -0,0 +1,48 @@
+{ pkgs, inputs, ...}:
+let
+ outside-emacs = [
+ (pkgs.python3.withPackages (p: (with p; [
+ python-lsp-server
+ python-lsp-ruff
+ pylsp-mypy
+ ])))
+ pkgs.nil
+ pkgs.rust-analyzer
+ pkgs.parallel
+ ];
+ org-tangle-elisp-blocks = (pkgs.callPackage ./org.nix {inherit pkgs; from-elisp = inputs.from-elisp;}).org-tangle ({ language, flags } :
+ let is-elisp = (language == "emacs-lisp") || (language == "elisp");
+ is-tangle = if flags ? ":tangle" then
+ flags.":tangle" == "yes" || flags.":tangle" == "y" else false;
+ in is-elisp && is-tangle
+ );
+ config-el = pkgs.writeText "config.el" (org-tangle-elisp-blocks (builtins.readFile ./README.org));
+ emacs = (pkgs.emacsWithPackagesFromUsePackage {
+ package = pkgs.emacs.override { withGTK3 = true; };
+ config = config-el;
+ alwaysEnsure = true;
+ defaultInitFile = true;
+ extraEmacsPackages = epkgs: with epkgs; [
+ (treesit-grammars.with-grammars (g: with g; [
+ tree-sitter-rust
+ tree-sitter-python
+ ]))
+ ] ++ outside-emacs;
+ override = final: prev: {
+ final.buildInputs = prev.buildInputs or [] ++ outside-emacs;
+ };
+ });
+in
+{
+ config = {
+ nixpkgs.overlays = [ inputs.emacs-overlay.overlays.default ];
+ environment.systemPackages = [
+ emacs
+ ] ++ outside-emacs;
+ fonts.packages = with pkgs; [
+ emacs-all-the-icons-fonts
+ (nerdfonts.override { fonts = ["Iosevka"]; })
+ ];
+ };
+}
+
diff --git a/modules/emacs/org.nix b/modules/emacs/org.nix
new file mode 100644
index 0000000..e5fd15c
--- /dev/null
+++ b/modules/emacs/org.nix
@@ -0,0 +1,11 @@
+{ pkgs, from-elisp }: {
+ org-tangle = block-predicate: text:
+ let blocks = (pkgs.callPackage from-elisp { inherit pkgs; }).parseOrgModeBabel text;
+ block-to-str = (block:
+ if block-predicate { inherit (block) language flags; } then
+ block.body
+ else
+ ""
+ );
+ in builtins.concatStringsSep "\n" (map block-to-str blocks);
+}
diff --git a/modules/gnome-config.nix b/modules/gnome-config.nix
new file mode 100644
index 0000000..a4a9b84
--- /dev/null
+++ b/modules/gnome-config.nix
@@ -0,0 +1,57 @@
+{ ... }:
+{
+ dconf.settings = {
+ "org/gnome/desktop/background" = {
+ picture-uri = "${../wallpaper.png}";
+ picture-options = "zoom";
+ };
+ "org/gnome/desktop/interface" = {
+ color-scheme="default";
+ enable-hot-corners=false;
+ font-antialiasing="grayscale";
+ font-hinting="slight";
+ gtk-theme="Orchis-Purple-Dark";
+ icon-theme="Papirus-Dark";
+ show-battery-percentage=true;
+ };
+ "org/gnome/desktop/peripherals/touchpad" = {
+ edge-scrolling-enabled=false;
+ natural-scroll=true;
+ tap-to-click=true;
+ two-finger-scrolling-enabled=true;
+ };
+ "org/gnome/mutter" = {
+ dynamic-workspaces= true;
+ edge-tiling= true;
+ workspaces-only-on-primary= true;
+ };
+ "org/gnome/settings-daemon/plugins/power" = {
+ power-button-action="hibernate";
+ sleep-inactive-ac-type="nothing";
+ };
+ # ========= GNOME SHELL ============
+ "org/gnome/shell" = {
+ enabled-extensions = [
+ "blur-my-shell@aunetx"
+ ];
+ disabled-extensions= [
+ ];
+ };
+ "org/gnome/shell/extensions/user-theme".name = "Orchis-Purple-Dark";
+ "org/gnome/shell/extensions/blur-my-shell/applications".whitelist = ["Emacs"];
+ "org/honem/shell/extensions/vitals" = {
+ hide-zeros = true;
+ position-in-panel = "0";
+ show-battery = false;
+ show-temperature = true;
+ };
+ "org/gnome/shell/app-switcher".current-workspace-only = true;
+ };
+}
diff --git a/modules/gnome.nix b/modules/gnome.nix
new file mode 100644
index 0000000..d00b935
--- /dev/null
+++ b/modules/gnome.nix
@@ -0,0 +1,63 @@
+{inputs, pkgs, ...}:
+{
+ config = {
+ # enable buffering for better perfomance
+ programs.dconf.enable = true;
+ nixpkgs.overlays = [
+ (final: prev: {
+ gnome = prev.gnome.overrideScope' (gnomeFinal: gnomePrev: {
+ mutter = gnomePrev.mutter.overrideAttrs ( old: {
+ src = pkgs.fetchgit {
+ url = "https://gitlab.gnome.org/vanvugt/mutter.git";
+ # GNOME 45: triple-buffering-v4-45
+ rev = "0b896518b2028d9c4d6ea44806d093fd33793689";
+ sha256 = "sha256-mzNy5GPlB2qkI2KEAErJQzO//uo8yO0kPQUwvGDwR4w=";
+ };
+ } );
+ });
+ })
+ ];
+ environment.systemPackages = with pkgs; [
+ gnome.gnome-tweaks
+ pkgs.orchis-theme
+ pkgs.papirus-icon-theme
+ ] ++ (with gnomeExtensions; [
+ appindicator
+ vitals
+ user-themes
+ blur-my-shell
+ gesture-improvements
+ ]);
+
+ environment.gnome.excludePackages = (with pkgs; [
+ gnome-photos
+ gnome-tour
+ gedit
+ ]) ++ (with pkgs.gnome; [
+ cheese # webcam tool
+ gnome-music
+ gnome-terminal
+ epiphany # web browser
+ geary # email reader
+ evince # document viewer
+ gnome-characters
+ totem # video player
+ tali # poker game
+ iagno # go game
+ hitori # sudoku game
+ atomix # puzzle game
+ ]);
+ services.xserver = {
+ displayManager.gdm = {
+ enable = true;
+ wayland = false;
+ };
+ desktopManager.gnome.enable = true;
+ };
+ services.udev.packages = [ pkgs.gnome.gnome-settings-daemon ];
+ services.gnome = {
+ gnome-browser-connector.enable = true;
+ gnome-keyring.enable = true;
+ };
+ };
+}
diff --git a/modules/s3nixcache-mixrank.nix b/modules/s3nixcache-mixrank.nix
new file mode 100644
index 0000000..0e80bdd
--- /dev/null
+++ b/modules/s3nixcache-mixrank.nix
@@ -0,0 +1,13 @@
+{
+ nix = {
+ settings = {
+ substituters = [
+ "s3://mr-nixcache-icenyeamyubu?profile=mixrank"
+ ];
+ trusted-public-keys = [
+ "mr-nixcache-icenyeamyubu:q2ulb+bD5NCbp9nvvHod39/1qNqnYX0ACb8eQckb7pI="
+ ];
+ };
+ };
+ networking.extraHosts = builtins.readFile /var/hosts.mixrank;
+}
diff --git a/secrets/authinfo.age b/secrets/authinfo.age
new file mode 100644
index 0000000..21f4ca2
--- /dev/null
+++ b/secrets/authinfo.age
@@ -0,0 +1,12 @@
+age-encryption.org/v1
+-> ssh-ed25519 JawxWA 6+++Sp7krSznpkEBKTcu5PSqDxpQANhoHhggfladJlE
+RtpSzvFLppsry2ZWIVFH4UI7kGsiPUtwYJAj2XfH970
+-> ssh-ed25519 F05xIw ajwZalRB44IaJ2LZ5dKYeVrE5Wk0TwEH+TD9P0Yo4hY
+BcP0cb15Xio+ESDDwMnmNREGCs7/ZzdMAV0nbs8BI2Q
+-> ssh-ed25519 AcegYA NQwlrijXQQPzC0cAVPmpPJEAaVIN6A82xJ12vkc6QR8
+3R2Np3ZIfYLF3pfADJOf/TpSdyPIZpjb3SqWCSpySpE
+--- 7qWqEseBRF/gl/3YLOZ0Fna9U85eCszcfoAVGzXGFdw
+��䢘o,�L��.�Z��3�S-Iy�y���1%�«aY�Y���Ae
+f�9yS���cE�DW��&\0����F,t�>z
+\�)]�{�U��h};�ҨM�Mca:�k���6@҃Q�h�=ڔ���JXp�4��gsh�ޠ�kat�҉��4c=�ޱQ���y��G�_i�&R��t\�b�Am����ˢ��&tg���r�j�t���Ƌms����Bʏx��c��`�~��W:4��-ʄ��e��cT@�jI��������v� ��ħt�#�
+C������$8�ڋ��ajs�3��5&&���y)��&|A�( ����ZO)D�� �(=м�S������.=�`-$1(��Q���4��a �O�7e�p \ No newline at end of file
diff --git a/secrets/personal-mail.age b/secrets/personal-mail.age
new file mode 100644
index 0000000..7f8072c
--- /dev/null
+++ b/secrets/personal-mail.age
@@ -0,0 +1,9 @@
+age-encryption.org/v1
+-> ssh-ed25519 JawxWA ek+BgeuSYquZpWknTLrxGrgkyjmHsiaYDDvtkfBE3x0
+bSATIWJK88UVpu5/6T8a/8Twqfh2ApLrh9HTWq5CqTU
+-> ssh-ed25519 F05xIw hhqGLOkUz5e4YsdcSDebjnLOv4fjrQHNBAouy4it304
+4sTwruQYAoE7+CB3j6LBqpdTJqOV8s0EQk9xi8dgmF0
+-> ssh-ed25519 AcegYA q/02iLU+0uf1yR6eUai/f3dKbk9+2XLbairfT/T+t2Y
+4GBX1lFjSKH2dgd+PeqezCmro1aKhPi7yoJJaCyGipg
+--- ziAnUhhn4pLfDdQUC00ib0ALzsyprniT+pbb5fQXyvs
+�^�̮��:�X������ ]y���03���!��+W�ꮹ�ſ�ؼD�w \ No newline at end of file
diff --git a/secrets/secrets.nix b/secrets/secrets.nix
new file mode 100644
index 0000000..9409b9e
--- /dev/null
+++ b/secrets/secrets.nix
@@ -0,0 +1,12 @@
+let
+ leonardo = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINWxS8tdN3j7Vm337RmJTzYTMbkAZN5g610ZesH4vhd8";
+ hanekawa = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOafACtb4IgSczDrollTm/t/xIYcVdLlUxDz72TxsZJZ";
+ kunagisa = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDrMCLu3VvQVmd2cqreAJsVKkrtKXqgzO8i8NDm06ysm";
+ keys = [ leonardo hanekawa kunagisa ];
+in
+{
+ "personal-mail.age".publicKeys = keys;
+ "work-mail.age".publicKeys = keys;
+ "university-mail.age".publicKeys = keys;
+ "authinfo.age".publicKeys = keys;
+}
diff --git a/secrets/university-mail.age b/secrets/university-mail.age
new file mode 100644
index 0000000..647b8b3
--- /dev/null
+++ b/secrets/university-mail.age
@@ -0,0 +1,9 @@
+age-encryption.org/v1
+-> ssh-ed25519 JawxWA 5BtipQ/iJ9e2aamkj4IT4KdEqif3tO9RfYEbTNCGXF0
+e+6+vJFPjxsLUc6Pfvavj+4IGBL4H+cijm7vXVIfvL0
+-> ssh-ed25519 F05xIw u6I7Y6Oik+3pYTvtqP4jwG4wMlt5g7W8zuxGLliKRWQ
+RBvUwFbeQKS9mca8pox4/bH4QwuRDPyP1xJdLPkuLrw
+-> ssh-ed25519 AcegYA hqXIMWz5LVv3QFHCqEzTFgY5433k13hi3QcHya3qIEM
+9W4vG9md42RRZagl42B7wjwwog4VB7SBYFiY0YX744g
+--- iXOaKcjnOcN9CElGnuuFyQylxMWWTBQH3feICpQigZk
+y�%�$�_�[>F�9�ժ}ŸsJd�a����n��`5�ۿ�$]���I�Z \ No newline at end of file
diff --git a/secrets/work-mail.age b/secrets/work-mail.age
new file mode 100644
index 0000000..96bab01
--- /dev/null
+++ b/secrets/work-mail.age
@@ -0,0 +1,10 @@
+age-encryption.org/v1
+-> ssh-ed25519 JawxWA NthvzwrERAo98v+7BAqKA4eEM2ArScGYAKIRy4UYCCQ
+kFMy9jK9Q8V9ZRQxol2aGqWqjJmPsyG3medf6BtxJBI
+-> ssh-ed25519 F05xIw V6YUGPePdAMohT583BPi6rVx8ZdtSoAbm+C+VzRVvwY
+YS18eCt7owunrAc9tqnJZfzXqY3xBoU95uyPI4rczDw
+-> ssh-ed25519 AcegYA mrJeHBHSZoW8Ux21GyUYPTNyf4GAfS/mB0B1z+t+XSQ
+MKjbe4cZBo75LuH9SD59u4n3TzJWX8R98B+Erd0QrwA
+--- xgTmywNfKJUfdNOYeYx/TGoI/KMsxB137Cl2tubQtoA
+L�8�Zޠ�x�C�z���&
+�%d�E�"�'�>;���ŭ� ��*Źr�b"� \ No newline at end of file
diff --git a/users/leonardo.nix b/users/leonardo.nix
new file mode 100644
index 0000000..726bea4
--- /dev/null
+++ b/users/leonardo.nix
@@ -0,0 +1,240 @@
+{ pkgs, config, inputs, ... }:
+{
+ imports = [
+ ../modules/gnome.nix
+ ../modules/emacs/emacs.nix
+ ../modules/s3nixcache-mixrank.nix
+ ];
+ config = {
+ nix = {
+ package = pkgs.nixVersions.nix_2_20;
+ settings = {
+ trusted-users = [ "root" "leonardo" ];
+ experimental-features = "nix-command flakes";
+ auto-optimise-store = true;
+ };
+ gc = {
+ automatic = true;
+ dates = "weekly";
+ options = "--delete-older-than 30d";
+ };
+ };
+
+ environment.systemPackages = [
+ pkgs.prismlauncher
+ ];
+
+ nixpkgs = {
+ config.allowUnfree = true;
+ config.allowUnfreePredicate = _: true;
+ };
+ programs.bash = {
+ vteIntegration = true;
+ enableLsColors = true;
+ enableCompletion = true;
+ promptInit =
+ ''
+ PS1="\e[0;95m\[[\h]\]\e[0m \e[0;32m\[\w\]\e[0m :: "
+ vterm_printf() {
+ if [ -n "$TMUX" ] && ([ "''${TERM%%-*}" = "tmux" ] || [ "''${TERM%%-*}" = "screen" ]); then
+ # Tell tmux to pass the escape sequences through
+ printf "\ePtmux;\e\e]%s\007\e\\" "$1"
+ elif [ "''${TERM%%-*}" = "screen" ]; then
+ # GNU screen (screen, screen-256color, screen-256color-bce)
+ printf "\eP\e]%s\007\e\\" "$1"
+ else
+ printf "\e]%s\e\\" "$1"
+ fi
+ }
+ vterm_prompt_end(){
+ vterm_printf "51;A$(whoami)@$(hostname):$(pwd)"
+ }
+ PS1=$PS1'\[$(vterm_prompt_end)\]'
+ '';
+ };
+ fonts = {
+ fontconfig = {
+ enable = true;
+ defaultFonts = {
+ monospace = [ "Iosevka" "IPAGothic" ];
+ serif = [ "DejaVu Serif" "IPAPMincho" ];
+ };
+ };
+ packages = with pkgs; [
+ (nerdfonts.override { fonts = [ "Iosevka" "FiraCode" ]; })
+ ipafont
+ kochi-substitute
+ dejavu_fonts
+ ];
+ };
+
+ programs.steam = {
+ enable = true;
+ remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
+ dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
+ };
+ programs.ssh = {
+ startAgent = true;
+ forwardX11 = true;
+ };
+ services.pipewire.enable = true;
+ services.openssh.enable = true;
+
+ users.users.leonardo = {
+ isNormalUser = true;
+ description = "leonardo";
+ extraGroups = [ "networkmanager" "wheel" ];
+ shell = pkgs.bashInteractive;
+ hashedPassword = "$y$j9T$NT9Ymktl8npD5RomDyBmK0$YfrrP0fcHRPcJZAAO.g8pRsSBoYvIq2aBBxBAHIesU2";
+ };
+
+ age.secrets = {
+ personal-mail = {
+ file = ../secrets/personal-mail.age;
+ owner = "1000";
+ group = "100";
+ };
+ work-mail = {
+ file = ../secrets/work-mail.age;
+ owner = "1000";
+ group = "100";
+ };
+ university-mail = {
+ file = ../secrets/university-mail.age;
+ owner = "1000";
+ group = "100";
+ };
+ authinfo = {
+ file = ../secrets/authinfo.age;
+ owner = "1000";
+ group = "100";
+ };
+ };
+
+ home-manager = {
+ useGlobalPkgs = true;
+ useUserPackages = true;
+ users.leonardo = { pkgs, ... } : {
+ imports = [ ./../modules/gnome-config.nix ];
+ home = {
+ file.".mozilla/firefox/leonardo/chrome/firefox-gnome-theme".source = inputs.firefox-gnome-theme;
+ username = "leonardo";
+ homeDirectory = "/home/leonardo";
+ stateVersion = "23.05";
+ sessionVariables.GTK_THEME = "Adwaita-dark";
+ packages = with pkgs; [
+ discord
+ slack
+ whatsapp-for-linux
+ telegram-desktop
+ firefox
+ ];
+ };
+ programs = {
+ firefox = {
+ enable = true;
+ profiles.leonardo = {
+ userChrome = ''
+ @import "firefox-gnome-theme/userChrome.css";
+ '';
+ userContent = ''
+ @import "firefox-gnome-theme/userContent.css";
+ '';
+ settings = {
+ "toolkit.legacyUserProfileCustomizations.stylesheets" = true; # Enable customChrome.cs
+ "browser.uidensity" = 0; # Set UI density to normal
+ "svg.context-properties.content.enabled" = true; # Enable SVG context-propertes
+ "browser.theme.dark-private-windows" = false; # Disable private window dark theme
+ };
+ };
+ };
+ bash = {
+ enable = true;
+ enableVteIntegration = true;
+ enableCompletion = true;
+ initExtra = ''
+ shopt -s -q autocd
+ shopt -s no_empty_cmd_completion
+ '';
+ };
+ fzf = {
+ enable = true;
+ enableBashIntegration = true;
+ };
+ direnv = {
+ enable = true;
+ enableBashIntegration = true;
+ nix-direnv.enable = true;
+ };
+ git = {
+ enable = true;
+ diff-so-fancy.enable = true;
+ extraConfig = {
+ user.name = "Leonardo Santiago";
+ user.email = "[email protected]";
+ color.ui = true;
+ };
+ };
+ mu.enable = true;
+ msmtp.enable = true;
+ mbsync.enable = true;
+ };
+
+ services.mbsync = {
+ enable = true;
+ frequency = "*:0/5";
+ };
+
+ accounts.email.accounts = {
+ personal = {
+ address = "[email protected]";
+ userName = "[email protected]";
+ imap.host = "imap.gmail.com";
+ smtp.host = "smtp.gmail.com";
+ primary = true;
+ realName = "Leonardo Ribeiro Santiago";
+ mbsync = {
+ enable = true;
+ create = "both";
+ expunge = "both";
+ };
+ msmtp.enable = true;
+ mu.enable = true;
+ passwordCommand = "cat ${config.age.secrets.personal-mail.path}";
+ };
+ university = {
+ address = "[email protected]";
+ userName = "[email protected]";
+ imap.host = "imap.gmail.com";
+ smtp.host = "smtp.gmail.com";
+ realName = "Leonardo Ribeiro Santiago";
+ mbsync = {
+ enable = true;
+ create = "both";
+ expunge = "both";
+ };
+ msmtp.enable = true;
+ mu.enable = true;
+ passwordCommand = "cat ${config.age.secrets.university-mail.path}";
+ };
+ work = {
+ address = "[email protected]";
+ userName = "[email protected]";
+ imap.host = "imap.gmail.com";
+ smtp.host = "smtp.gmail.com";
+ realName = "Leonardo Ribeiro Santiago";
+ mbsync = {
+ enable = true;
+ create = "both";
+ expunge = "both";
+ };
+ msmtp.enable = true;
+ mu.enable = true;
+ passwordCommand = "cat ${config.age.secrets.work-mail.path}";
+ };
+ };
+ };
+ };
+
+ };
+}
diff --git a/wallpaper.png b/wallpaper.png
new file mode 100644
index 0000000..02c7818
--- /dev/null
+++ b/wallpaper.png
Binary files differ