diff --git a/README.md b/README.md index b209d2e..f6bc728 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,25 @@ +uhuh yeah endgame nixos config + +# Install +if you're me, you need to bootstrap your secrets for agenix to work right: +``` +cp -r /home/sync/.ssh /mnt/home/sync/.ssh +cp /home/sync/Passwords.kdbx /mnt/home/sync/.config/keep +``` +if you're not me, you probably have to go in my config and change things for nix to build everything. + +then, proceed with regular installation: +``` +sudo nixos-install --root /mnt --flake github:jakeginesin/nix-dots#thonkpad +``` +And rebuild with: +``` +sudo nixos-rebuild switch --flake.#thonkpad +``` + # Some crazy dotfiles - [Sylk0s](https://github.com/sylk0s/dotfiles) - [Cajunvoodoo's](https://github.com/Cajunvoodoo/dotfiles) +- [damhiya](https://github.com/damhiya) +- [masterofnull](https://github.com/MasterofNull/nixos) +- [hlissner](https://github.com/hlissner/dotfiles) (also uses bspwm) diff --git a/configuration.nix b/configuration.nix deleted file mode 100644 index 763794a..0000000 --- a/configuration.nix +++ /dev/null @@ -1,217 +0,0 @@ -# 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, - ... -}: let - pkg_with_working_nitrogen = import (builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/c0c50dfcb70d48e5b79c4ae9f1aa9d339af860b4.tar.gz"; - sha256 = "17p3w4mgfr4yj2p0jz6kqgzhyr04h4fap5hnd837664xd1xhwdjb"; - }) {inherit (pkgs) system;}; - - old-nitrogen = pkg_with_working_nitrogen.nitrogen; -in { - imports = [ - # ./hardware-configuration.nix - ./system/system.nix - ]; - - # Bootloader. - boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/nvme0n1"; - boot.loader.grub.useOSProber = true; - - networking.hostName = "thonkpad"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - nix = { - nixPath = [ - "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos" - "nixos-config=/home/synchronous/nix-cfg/configuration.nix" - "/nix/var/nix/profiles/per-user/root/channels" - ]; - - settings = { - experimental-features = ["nix-command" "flakes"]; - substituters = [ - "https://nix-community.cachix.org" - ]; - trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - ]; - }; - }; - - # 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/New_York"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - - # Enable CUPS to print documents. - services.printing.enable = true; - hardware.bluetooth.enable = true; - - # Enable sound with pipewire. - 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; - - users.users.synchronous = { - isNormalUser = true; - description = "jake"; - extraGroups = ["networkmanager" "wheel"]; - packages = with pkgs; [ - kdePackages.kate - # firefox - git - arandr - procs - htop - zsh - ripgrep - rofi - alacritty - python3 - tree - old-nitrogen - polybar - sxhkd - bspwm - # librewolf - eza - flameshot - neofetch - lolcat - nnn - xclip - brightnessctl - xbindkeys - pulseaudio - xorg.xf86inputsynaptics - libnotify # for notify-send - alejandra - discord - legcord - polybar-pulseaudio-control - bluez # polybar - zotero - texliveFull - texlivePackages.latexmk - nmap - procps # for pgrep - # xorg.xrandr - # thunderbird - ]; - }; - - security.sudo = { - # me ne frego. i dare you to privilege escalate me - enable = true; - extraRules = [ - { - commands = [ - { - command = "/home/synchronous/nix-cfg/home/scripts/nixos-rebuild.sh"; - options = ["NOPASSWD"]; - } - { - command = "/home/synchronous/.scripts/nixos-rebuild.sh"; - options = ["NOPASSWD"]; - } - { - # are you serious? - command = "/run/current-system/sw/bin/nixos-rebuild switch --flake /home/synchronous/nix-cfg/flake.nix"; - options = ["NOPASSWD"]; - } - ]; - users = ["synchronous"]; - } - ]; - }; - - # Allow unfree packages - # nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - vim - neovim - linux-manual - man-pages - man-pages-posix - fontconfig - python3 - rofi - flameshot - tree - # nitrogen - polybar - sxhkd - bspwm - # librewolf - ]; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = 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 = "24.11"; # Did you read the comment? -} diff --git a/flake.lock b/flake.lock index 0fcc9e1..d26c02e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,35 +1,81 @@ { "nodes": { - "flake-parts": { + "agenix": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib" + "darwin": "darwin", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "systems": "systems" }, "locked": { - "lastModified": 1733312601, - "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "lastModified": 1745630506, + "narHash": "sha256-bHCFgGeu8XjWlVuaWzi3QONjDW3coZDqSHvnd4l7xus=", + "owner": "ryantm", + "repo": "agenix", + "rev": "96e078c646b711aee04b82ba01aefbff87004ded", "type": "github" }, "original": { - "owner": "hercules-ci", - "repo": "flake-parts", + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1744478979, + "narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "43975d782b418ebf4969e9ccba82466728c2851b", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", "type": "github" } }, "home-manager": { "inputs": { "nixpkgs": [ + "agenix", "nixpkgs" ] }, "locked": { - "lastModified": 1734622215, - "narHash": "sha256-OOfI0XhSJGHblfdNDhfnn8QnZxng63rWk9eeJ2tCbiI=", + "lastModified": 1745494811, + "narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=", "owner": "nix-community", "repo": "home-manager", - "rev": "1395379a7a36e40f2a76e7b9936cc52950baa1be", + "rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1745703610, + "narHash": "sha256-KgaGPlmjJItZ+Xf8mSoRmrsso+sf3K54n9oIP9Q17LY=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "2f5819a962489e037a57835f63ed6ff8dbc2d5fb", "type": "github" }, "original": { @@ -40,37 +86,56 @@ }, "nixpkgs": { "locked": { - "lastModified": 1734424634, - "narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=", - "owner": "nixos", + "lastModified": 1745391562, + "narHash": "sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33", + "rev": "8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-lib": { + "nixpkgs_2": { "locked": { - "lastModified": 1733096140, - "narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz" + "lastModified": 1745526057, + "narHash": "sha256-ITSpPDwvLBZBnPRS2bUcHY3gZSwis/uTe255QgMtTLA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f771eb401a46846c1aebd20552521b233dd7e18b", + "type": "github" }, "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz" + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" } }, "root": { "inputs": { - "flake-parts": "flake-parts", - "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "agenix": "agenix", + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index f7fc67f..fe5b17e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,102 +1,53 @@ { - description = "Nixos config flake"; + description = "NixOS system configuration"; + + nixConfig = { + # substituters = [ + # "https://cache.nixos.org/" + # "https://nix-community.cachix.org" + # ]; + # trusted-public-keys = [ + # "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + # "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + # ]; + }; inputs = { - flake-parts.url = "github:hercules-ci/flake-parts"; - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - - # haumea = { - # url = "github:nix-community/haumea/v0.2.2"; - # inputs.nixpkgs.follows = "nixpkgs"; - # }; + agenix.url = "github:ryantm/agenix"; }; - outputs = inputs @ { - flake-parts, + outputs = { self, nixpkgs, - ... - }: - flake-parts.lib.mkFlake { - inherit inputs; - } { - imports = []; - - systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"]; - perSystem = { - config, - self, - inputs, - system, - nixpkgs, - pkgs, - ... - }: { - # Per-system attributes can be defined here. The self' and inputs' - # module parameters provide easy access to attributes of the same - # system. - - # Equivalent to inputs'.nixpkgs.legacyPackages.hello; - # packages.default = pkgs.hello; - # formatter = pkgs.nixfmt-rfc-style; - - formatter = pkgs.alejandra; - }; - flake = { - # The usual flake attributes can be defined here, including system- - # agnostic ones like nixosModule and system-enumerating ones, although - # those are more easily expressed in perSystem. - # nixosConfigurations.myhostname = "thonkpad"; - nixosConfigurations.thonkpad = inputs.nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - pkgs = import inputs.nixpkgs { - inherit system; - - config = { - allowUnfree = true; - packageOverrides = pkgs: { - # "package" = pkgs."package".overrideAttrs (attrs: {...}) - }; - }; - overlays = []; - - # home.packages = with pkgs; [xrandr procps polybar bspwm sxhkd polybar-pulseaudio-control bluez]; - }; - - specialArgs = {inherit inputs;}; - # extraSpecialArgs = {inherit inputs;}; - modules = [ - ./configuration.nix - # self.module - inputs.home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.synchronous = import ./home/home.nix; - home-manager.extraSpecialArgs = {inherit inputs;}; - home-manager.backupFileExtension = "hm-backup"; - - # Optionally, use home-manager.extraSpecialArgs to pass - # arguments to home.nix - } - ]; - }; - }; - - # outputs = { self, nixpkgs, ... }@inputs: { - # nixosConfigurations.default = nixpkgs.lib.nixosSystem { - # specialArgs = {inherit inputs;}; - # modules = [ - # ./configuration.nix - # # inputs.home-manager.nixosModules.default - # { home-manager.users.synch = import ./home.nix; } - # ]; - # }; - # }; + home-manager, + agenix, + }: let + baseModule = { + # imports = [ + # home-manager.nixosModules.default + # ]; + system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; + nixpkgs.overlays = []; }; + in { + nixosConfigurations.thonkpad = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + + modules = [ + baseModule + { + environment.systemPackages = [agenix.packages.x86_64-linux.default]; + } + home-manager.nixosModules.default + agenix.nixosModules.default + # agenix.homeManagerModules.age + ./hosts/thonkpad/configuration.nix + ]; + }; + }; } diff --git a/home/home.nix b/home/home.nix index 9e99542..fea1b43 100644 --- a/home/home.nix +++ b/home/home.nix @@ -24,12 +24,18 @@ in { home.stateVersion = "24.11"; # Please read the comment before changing. + # age.secrets.zsh_remote.file = ../secrets/zsh_remote.age; + # age.secretsDir = "/home/synchronous/.agenix/agenix"; + # age.secretsMountPoint = "/home/synchronous/.agenix/agenix.d"; + # age.identityPaths = ["/home/synchronous/.ssh/id_ed25519"]; + # home.packages = with pkgs; [xrandr procps polybar bspwm sxhkd polybar-pulseaudio-control bluez]; home.sessionVariables = { EDITOR = "nvim"; HOME = "/home/synchronous"; XDG_CACHE_HOME = "$HOME/.cache"; + DBUS_SESSION_BUS_ADDRESS = "unix:path=$XDG_RUNTIME_DIR/bus"; }; programs.home-manager.enable = true; @@ -45,6 +51,8 @@ in { beets netcat zathura + keepassxc + sshpass ] ++ ( with lib; let @@ -64,4 +72,10 @@ in { (builtins.readFile file) ) ); + + # home.file.".profile".text = '' + # if [ -f "$HOME/.scripts/res.sh" ]; then + # . "$HOME/.scripts/res.sh" + # fi + # ''; } diff --git a/home/programs/bspwm/bspwmrc b/home/programs/bspwm/bspwmrc index 0332449..ca41340 100644 --- a/home/programs/bspwm/bspwmrc +++ b/home/programs/bspwm/bspwmrc @@ -10,9 +10,10 @@ pgrep -x sxhkd > /dev/null || sxhkd & # xrandr --output eDP-1 --mode 1920x1080 --primary # xrandr --output HDMI-1 --mode 1920x1080 --same-as eDP-1 --scale 1x1 -xrandr --output eDP-1 --scale 1x1 --auto +# xrandr --output eDP-1 --scale 1x1 --auto +xrandr --output LVDS-1 --mode 1366x768 --primary -bspc monitor eDP-1 -d 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +bspc monitor LVDS-1 -d 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 bspc config border_width 2 bspc config window_gap 2 diff --git a/home/programs/firefox/default.nix b/home/programs/firefox/default.nix index e68fafd..32a0a33 100644 --- a/home/programs/firefox/default.nix +++ b/home/programs/firefox/default.nix @@ -1,8 +1,17 @@ { pkgs, lib, + osConfig, ... -}: { +}: let + # osConfig carries config from configuration.nix + scale = + if osConfig.res == "1366x768" + then 0.80 + else if osConfig.res == "2560x1440" + then 1.25 + else 1.00; +in { home.activation.copyStartpage = lib.mkAfter '' mkdir -p ~/.firefox-startpage cp -r ${./startpage}/* ~/.firefox-startpage/ @@ -118,10 +127,10 @@ # for tiling window managers expands to the size of the window # https://support.mozilla.org/en-US/questions/1253302 - "mousewheel.with_control.action" = "1"; + "mousewheel.with_control.action" = 1; # should change this based on your resolution - "layout.css.devPixelsPerPx" = 1.25; + "layout.css.devPixelsPerPx" = scale; "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; "full-screen-api.ignore-widgets" = true; diff --git a/home/programs/git/default.nix b/home/programs/git/default.nix index f2fe278..57b79b7 100644 --- a/home/programs/git/default.nix +++ b/home/programs/git/default.nix @@ -3,6 +3,7 @@ pkgs, ... }: { + services.ssh-agent.enable = true; programs.git = { enable = true; package = pkgs.gitAndTools.gitFull; diff --git a/home/programs/keepassxc/default.nix b/home/programs/keepassxc/default.nix new file mode 100644 index 0000000..e44a17f --- /dev/null +++ b/home/programs/keepassxc/default.nix @@ -0,0 +1,7 @@ +{ + config, + pkgs, + ... +}: { + home.file.".config/keepassxc/keepassxc.ini".source = ./keepassxc.ini; +} diff --git a/home/programs/keepassxc/keepassxc.ini b/home/programs/keepassxc/keepassxc.ini new file mode 100644 index 0000000..5ae798f --- /dev/null +++ b/home/programs/keepassxc/keepassxc.ini @@ -0,0 +1,21 @@ +[General] +ConfigVersion=2 + +[Browser] +CustomProxyLocation= + +[GUI] +ApplicationTheme=dark +ShowExpiredEntriesOnDatabaseUnlockOffsetDays=6 +TrayIconAppearance=monochrome-light + +[PasswordGenerator] +AdditionalChars= +ExcludedChars= +Length=31 +LowerCase=true +Numbers=true +SpecialChars=true +UpperCase=true +WordCount=8 +WordSeparator=! diff --git a/home/programs/nf/default.nix b/home/programs/nf/default.nix new file mode 100644 index 0000000..a3cf446 --- /dev/null +++ b/home/programs/nf/default.nix @@ -0,0 +1,12 @@ +{ + config, + pkgs, + lib, + ... +}: { + home.activation.makeNfDir = lib.mkAfter '' + mkdir -p ~/journal + mkdir -p ~/journal/rest + chmod -R u+w ~/journal + ''; +} diff --git a/home/programs/nitrogen/nitrogen.cfg b/home/programs/nitrogen/nitrogen.cfg index 8453943..25f389b 100644 --- a/home/programs/nitrogen/nitrogen.cfg +++ b/home/programs/nitrogen/nitrogen.cfg @@ -9,4 +9,4 @@ view=icon recurse=true sort=alpha icon_caps=false -dirs=/home/synchronous/.wallpapers; +dirs=$HOME/.wallpapers; diff --git a/home/programs/nvim/default.nix b/home/programs/nvim/default.nix index 68206fd..e248e32 100644 --- a/home/programs/nvim/default.nix +++ b/home/programs/nvim/default.nix @@ -30,6 +30,7 @@ rust-analyzer-unwrapped black nodejs_22 + latexrun # gh ]; diff --git a/home/programs/nvim/plugins/goyo.lua b/home/programs/nvim/plugins/goyo.lua index 7692e06..6048bbb 100644 --- a/home/programs/nvim/plugins/goyo.lua +++ b/home/programs/nvim/plugins/goyo.lua @@ -12,3 +12,51 @@ vim.api.nvim_create_autocmd("VimResized", { end end, }) + +-- hide and unhide lualine when entering and leaving goyo + +local lualine = require('lualine') +local grp = vim.api.nvim_create_augroup('goyo_lualine_toggle', { clear = true }) + +local function hide() lualine.hide{ place = {'statusline', 'winbar', 'tabline'} } end +local function unhide() lualine.hide{ place = {'statusline', 'winbar', 'tabline'}, unhide = true } end + + +vim.api.nvim_create_autocmd('User', { + group = grp, + pattern = 'GoyoEnter', + callback = function() + lualine.hide({ place = {'statusline', 'winbar', 'tabline'} }) + end, +}) + +vim.api.nvim_create_autocmd('User', { + group = grp, + pattern = 'GoyoLeave', + callback = function() + lualine.hide({ place = {'statusline', 'winbar', 'tabline'}, unhide = true }) + end, +}) + +vim.api.nvim_create_autocmd('VimEnter', { + group = grp, + once = true, + callback = function() + local w = vim.g.goyo_if + if w then + vim.schedule(hide) + end + end, +}) + +vim.api.nvim_create_autocmd('UIEnter', { + once = true, + group = grp, + callback = function() + local w = vim.g.goyo_if + if w then + vim.opt.showtabline = 0 + vim.cmd('BarbarDisable') + end + end, +}) diff --git a/home/programs/polybar/config.ini b/home/programs/polybar/config.ini index 4329d24..f189c9f 100644 --- a/home/programs/polybar/config.ini +++ b/home/programs/polybar/config.ini @@ -19,9 +19,9 @@ line-size = 3 ;locale = tr_TR.UTF-8 width = 99.7% -height = 25 -offset-x = 4 -offset-y = 3 +; height = 25 +; offset-x = 4 +; offset-y = 3 padding-left = 2 padding-right = 2 module-margin-left = 3 @@ -29,14 +29,16 @@ module-margin-right = 0 tray-position = right tray-detached = false +; font-0 = "NotoSans-Regular:size=11;2.5" +; font-1 = "JetBrainsMono Nerd Font:style=Regular:size=11;2.5" +; font-2 = "Noto Sans Symbols:size=13;1" + background = ${colors.background} foreground = ${colors.foreground} + ; noto -> text font ; jetbrains -> icons -font-0 = "NotoSans-Regular:size=11;2.5" -font-1 = "JetBrainsMono Nerd Font:style=Regular:size=11;2.5" -font-2 = "Noto Sans Symbols:size=13;1" ; font-0 = B612:style=Regular:size=9;3 ; font-0 = "NotoSans Nerd Font:size=9;3" diff --git a/home/programs/polybar/default.nix b/home/programs/polybar/default.nix index 8bfe10f..5440947 100644 --- a/home/programs/polybar/default.nix +++ b/home/programs/polybar/default.nix @@ -2,6 +2,7 @@ config, pkgs, lib, + osConfig, ... }: let mypolybar = pkgs.polybar.override { @@ -37,6 +38,43 @@ # ${ip} route | ${grep} default | ${awk} '{print $5}' > $out # ''; + hd = '' + [bar/mybar] + height = 20 + font-0 = "NotoSans-Regular:size=9;2.5" + font-1 = "JetBrainsMono Nerd Font:style=Regular:size=9;2.5" + font-2 = "Noto Sans Symbols:size=9;1" + offset-x = 2 + offset-y = 2 + ''; + + fhd = '' + [bar/mybar] + height = 20 + font-0 = "NotoSans-Regular:size=11;2.5" + font-1 = "JetBrainsMono Nerd Font:style=Regular:size=11;2.5" + font-2 = "Noto Sans Symbols:size=11;1" + offset-x = 4 + offset-y = 3 + ''; + + qhd = '' + [bar/mybar] + height = 25 + font-0 = "NotoSans-Regular:size=11;2.5" + font-1 = "JetBrainsMono Nerd Font:style=Regular:size=11;2.5" + font-2 = "Noto Sans Symbols:size=13;1" + offset-x = 4 + offset-y = 3 + ''; + + mon = + if osConfig.res == "1366x768" + then hd + else if osConfig.res == "2560x1440" + then qhd + else fhd; + internets = '' [module/network] type = internal/network @@ -61,7 +99,7 @@ in { enable = true; package = mypolybar; config = ./config.ini; - extraConfig = bctl + internets; + extraConfig = bctl + internets + mon; # my savior: https://www.reddit.com/r/NixOS/comments/v8ikwq/polybar_doesnt_start_at_launch/ script = '' # echo "none" diff --git a/home/programs/programs.nix b/home/programs/programs.nix index d65995d..8b38da7 100644 --- a/home/programs/programs.nix +++ b/home/programs/programs.nix @@ -13,7 +13,6 @@ # ./nitrogen/defualt.nix ./rofi/default.nix ./polybar/default.nix - # wm stuff ./sxhkd/default.nix ./bspwm/default.nix @@ -23,5 +22,7 @@ ./firefox/default.nix ./git/default.nix ./zathura/default.nix + ./keepassxc/default.nix + ./nf/default.nix ]; } diff --git a/home/programs/rofi/styles/prompt-search.rasi b/home/programs/rofi/styles/prompt-search.rasi new file mode 100644 index 0000000..e380159 --- /dev/null +++ b/home/programs/rofi/styles/prompt-search.rasi @@ -0,0 +1,91 @@ +@import "/home/synchronous/.config/rofi/styles/colors.rasi" + +configuration { + show-icons: false; +} + +* { + pink: @base0C; + cyan: @base0F; + green: #9ece6a; + + accent-color: @base06; + urgent-color: @base0A; + + background-color: transparent; + text-color: @text; + margin: 0; + padding: 0; +} + +window { + location: center; + anchor: center; + fullscreen: false; + y-offset: 0px; + + enabled: true; + background-color: @background; + cursor: "default"; + border: 1px; + border-color: #565657; + width: 500px; +} + +inputbar { + enabled: true; + background-color: @prompt; + padding: 10px; + children: ["entry"]; +} + +entry { + enabled: true; + padding: 0.75em 0.75em; + cursor: text; +} + +listview { + enabled: true; + columns: 1; + lines: 10; + cycle: true; + dynamic: true; + scrollbar: false; + layout: vertical; + reverse: false; + fixed-height: true; + fixed-columns: true; + margin: 0.25em 0 0.25em; + cursor: "default"; +} + +prompt { + text-color: @accent-color; + +} + +textbox { + padding: 0.5em 1.5em; + background-color: @prompt; +} + +element { + enabled: true; + margin: 0 0.25em; + padding: 0.5em 0.75em; + cursor: pointer; + orientation: vertical; +} + +element-text { + highlight: @green; + cursor: inherit; + vertical-align: 0.5; + horizontal-align: 0.0; + font: "Liga SFMono Nerd Font 14"; +} + +element-text selected { + text-color: @cyan; +} diff --git a/home/programs/sxhkd/sxhkdrc b/home/programs/sxhkd/sxhkdrc index e15196d..3788ccc 100644 --- a/home/programs/sxhkd/sxhkdrc +++ b/home/programs/sxhkd/sxhkdrc @@ -181,18 +181,18 @@ super + bracket{left,right} # alacritty -e nvim /home/synchronous/Documents/Obsidian/Journal/Daily.md -c "execute 'normal G' | Goyo | autocmd VimResized * call GoyoWrapper()" # open my notes file in nvim w/ a new alacritty window, then jump to end of file super + {o} - open_daily + sh nf daily # open my notes without goyo and with nvimteee super + {shift} + {o} - alacritty -e nvim /home/synchronous/journal/Daily.md -c "execute 'normal G' | NvimTreeOpen /home/synchronous/journal" + sh nf daily # search my notes using rofi and open the right one super + {ctrl} + {o} - sh /home/synchronous/.scripts/vimwiki/search_notes.sh + sh nf search -super + {ctrl} + {p} - sh /home/synchronous/.scripts/papers/paper-search-cached.sh +# super + {ctrl} + {p} + # sh /home/synchronous/.scripts/papers/paper-search-cached.sh super + {ctrl} + {l} sh /home/synchronous/.scripts/papers/paper-search.sh @@ -211,7 +211,8 @@ super + {alt} + {c} find /home/synchronous/current-semester -follow -maxdepth 1 | cut -c36- | sed '/^[[:space:]]*$/d' | rofi -dmenu | read rsem; yq ".url" "/home/synchronous/current-semester/$rsem/info.yaml" | xargs firefox super + {p} - sh /home/synchronous/.scripts/vimwiki/open_todo.sh + # sh /home/synchronous/.scripts/vimwiki/open_todo.sh + nf todo super + {m} sh /home/synchronous/.scripts/vimwiki/open-learning.sh diff --git a/home/programs/zsh/default.nix b/home/programs/zsh/default.nix index 94895be..dc624f9 100644 --- a/home/programs/zsh/default.nix +++ b/home/programs/zsh/default.nix @@ -2,6 +2,8 @@ pkgs, lib, system, + config, + osConfig, ... }: { home.packages = with pkgs; [zsh-powerlevel10k meslo-lgs-nf]; @@ -39,6 +41,13 @@ [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh ''; - initExtra = builtins.readFile ./zshrc; + # recall agenix secrets cannot be used at eval time, so we must do this trash + # like what the fuck? I spent 4 hours figuring this out. will i ever reach nix nirvana? + initExtra = '' + ${builtins.readFile ./zshrc} + if [ -f "${osConfig.age.secrets.zsh_remote.path}" ]; then + source "${osConfig.age.secrets.zsh_remote.path}" + fi + ''; }; } diff --git a/home/programs/zsh/zshrc b/home/programs/zsh/zshrc index fbd9576..5929134 100644 --- a/home/programs/zsh/zshrc +++ b/home/programs/zsh/zshrc @@ -172,7 +172,7 @@ alias ytdl-mp3="yt-dlp -x --audio-format mp3 --audio-quality 0 -o '/home/synchro alias ntpsync="sudo ntpdate pool.ntp.org" # alias fb="cd /home/synchronous/code/tob/fb" alias nuid="echo 002141542" -# alias gb="sh /home/synchronous/.scripts/bluetooth/gb.sh" +alias gb="sh /etc/profiles/per-user/synchronous/bin/gb" alias gbdc="bluetoothctl disconnect" # alias sxhkdrc="vim /home/synchronous/.config/sxhkd/sxhkdrc" # alias bspwmrc="vim /home/synchronous/.config/bspwm/bspwmrc" diff --git a/home/scripts/journal/nf.sh b/home/scripts/journal/nf.sh new file mode 100644 index 0000000..8fb240b --- /dev/null +++ b/home/scripts/journal/nf.sh @@ -0,0 +1,167 @@ +#!/usr/bin/env bash + +main="/home/synchronous/journal" +#main_dir="$main/abstract" +#main="/home/synchronous/code/nm/notes" +main_dir="$main/rest" +rofi_prompt="/home/synchronous/.config/rofi/styles/prompt-search.rasi" +len_maindir=${#main_dir} + +search() { + rs="$(find "$main_dir" -follow -printf "%T@ %Tc %p\n" | sort -n -r | cut -c"$((len_maindir + 56))"- | rg -a '\.md$')" + rcv=$(echo "$rs" | rofi -dmenu -theme "$rofi_prompt") + if [[ "$rcv" == "" ]]; then exit 1; fi + if [[ $(echo "$rs" | rg "$rcv") ]]; then # check if we actually have our note + alacritty -t "$rcv" -e nvim "$main_dir/$rcv" \ + -c "execute 'lua vim.g.goyo_if = 1' | Goyo | execute 'normal 4j' | set path+=$main_dir | autocmd BufEnter * let b:coc_suggest_disable=1" &! + # -c "lua vim.g.goyo_if = 1" + # -c "syntax match LinkPattern /[a-zA-Z0-9\-][a-zA-Z0-9\-]*\.md/" \ + # -c "highlight LinkPattern guifg=LightBlue gui=underline" \ + # -c "nnoremap :call CustomGf()" \ + # -c "nnoremap gf :call CustomGf()" \ + else + + # if rcv doesn't contain md, add it + if [[ $(echo "$rcv" | rg -v '\.md$') ]]; then + rcv="$rcv.md" + fi + + no_md="${rcv%.md}" + replaced="${no_md//[-_]/ }" + # echo "lol" + + alacritty -t "$rcv" -e nvim "$main_dir/$rcv" \ + -c "execute 'lua vim.g.goyo_if = 1' | Goyo | set path+=$main_dir | autocmd BufEnter * let b:coc_suggest_disable=1" \ + -c "call setline(1, ['---', 'title: $replaced', 'tags: ', '---', '']) | execute 'normal G'" &! + # make sure standardized frontmatter is there + fi +} + +open_daily() { + alacritty -t "daily.md" -e nvim "$main/daily.md" \ + -c "Goyo | set path+=$main_dir" \ + -c "execute 'normal G'" \ + -c "lua vim.g.goyo_if = 1" &! +} + +open_todo() { + alacritty -t "todo.md" -e nvim "$main/todo.md" \ + -c "execute 'lua vim.g.goyo_if = 1' | Goyo | set path+=$main_dir" &! + # -c "execute 'normal G'" +} + +notes_find() { + rg $2 $main_dir +} + +search_by_tags() { + tt="" + # while IFS= read -r -d '' file; do + # is_tags=$(awk 'NR==3 {print substr($0, 1, 4)}' "$file") + # if [[ $is_tags == "tags" ]]; then + # line=$(sed -n '3p' "$file") + # tt+=$(echo "$file" | cut -c"$((len_maindir + 2))"- ) + # tt+=" [$(echo "$line" | cut -c7-)]\n" + # fi + # done < <(find $main_dir -type f -print0) + + rs="$(find "$main_dir" -follow -printf "%T@ %Tc %p\n" | sort -n -r | cut -c"$((len_maindir + 49))"- | rg -a '\.md$')" + + while IFS= read -r -d '' file; do + { read -r _; read -r _; read -r line; } < "$file" + + if [[ ${line:0:4} == "tags" ]]; then + tags="${line:6}" + tags="${tags#"${tags%%[![:space:]]*}"}" + tags="${tags%"${tags##*[![:space:]]}"}" + filename="${file:$((len_maindir + 1))}" + tt+="$filename [$tags]\n" + fi + done < <(find "$main_dir" -type f -print0) + + rcv=$(echo -e "$tt" | awk 'NR > 1 {print prev} {prev=$0} END {printf "%s", prev}' | rofi -dmenu -theme "$rofi_prompt") + rcv=$(echo $rcv | sed 's/ \[[^]]*\]$//') + if [[ "$rcv" == "" ]]; then exit 1; fi + if [[ $(echo "$rs" | rg "$rcv") ]]; then # check if we actually have our note + alacritty -t "$rcv" -e nvim "$main_dir/$rcv" \ + -c "execute 'lua vim.g.goyo_if = 1' | Goyo | execute 'normal 4j' | set path+=$main_dir | autocmd BufEnter * let b:coc_suggest_disable=1" &! + else + + # if rcv doesn't contain md, add it + if [[ $(echo "$rcv" | rg -v '\.md$') ]]; then + rcv="$rcv.md" + fi + + no_md="${rcv%.md}" + replaced="${no_md//[-_]/ }" + + alacritty -t "$rcv" -e nvim "$main_dir/$rcv" \ + -c "execute 'lua vim.g.goyo_if = 1' | Goyo | set path+=$main_dir | autocmd BufEnter * let b:coc_suggest_disable=1" \ + -c "call setline(1, ['---', 'title: $replaced', 'tags: ', '---', '']) | execute 'normal G'" &! + fi +} + +search_by_title() { + # tt="" + # while IFS= read -r -d '' file; do + # is_title=$(awk 'NR==2 {print substr($0, 1, 5)}' "$file") + # if [[ $is_title == "title" ]]; then + # line=$(sed -n '2p' "$file") + # # tt+="$(echo "$line" | cut -c7-)" + # tt+="$(echo "$line" | cut -c7- | sed 's/^ *//; s/ *$//')" + # tt+=' ('$(echo "$file" | cut -c"$((len_maindir + 2))"- )')\n' + # fi + # done < <(find $main_dir -type f -print0) + + rs="$(find "$main_dir" -follow -printf "%T@ %Tc %p\n" | sort -n -r | cut -c"$((len_maindir + 49))"- | rg -a '\.md$')" + + tt="" + while IFS= read -r -d '' file; do + { read -r _; read -r line; } < "$file" + + if [[ ${line:0:5} == "title" ]]; then + title="${line:6}" + + title="${title#"${title%%[![:space:]]*}"}" + title="${title%"${title##*[![:space:]]}"}" + filename="${file:$((len_maindir + 1))}" + tt+="$title ($filename)\n" + fi + done < <(find "$main_dir" -type f -print0) + + rcv=$(echo -e "$tt" | awk 'NR > 1 {print prev} {prev=$0} END {printf "%s", prev}' | rofi -dmenu -theme "$rofi_prompt") + rcv=$(echo $rcv | rg -e "[a-zA-Z0-9]*\.md" -o) + if [[ "$rcv" == "" ]]; then exit 1; fi + # echo "$rcv" + if [[ $(echo "$rs" | rg "$rcv") ]]; then # check if we actually have our note + alacritty -t "$rcv" -e nvim "$main_dir/$rcv" \ + -c "execute 'lua vim.g.goyo_if = 1' | Goyo | execute 'normal 4j' | set path+=$main_dir | autocmd BufEnter * let b:coc_suggest_disable=1" &! + else + + # if rcv doesn't contain md, add it + if [[ $(echo "$rcv" | rg -v '\.md$') ]]; then + rcv="$rcv.md" + fi + + no_md="${rcv%.md}" + replaced="${no_md//[-_]/ }" + + alacritty -t "$rcv" -e nvim "$main_dir/$rcv" \ + -c "execute 'lua vim.g.goyo_if = 1' | Goyo | set path+=$main_dir | autocmd BufEnter * let b:coc_suggest_disable=1" \ + -c "call setline(1, ['---', 'title: $replaced', 'tags: ', '---', '']) | execute 'normal G'" &! + fi +} + +run_command() { + case $1 in + "search") search ;; + "daily") open_daily ;; + "todo") open_todo ;; + "find") notes_find ;; + "tags") search_by_tags ;; + "title") search_by_title ;; + *) + esac +} + +run_command "$1" diff --git a/home/scripts/rebuild.sh b/home/scripts/rebuild.sh index b6e11cd..d738f6f 100644 --- a/home/scripts/rebuild.sh +++ b/home/scripts/rebuild.sh @@ -14,7 +14,7 @@ if git --git-dir /home/synchronous/nix-cfg/.git diff-index --quiet HEAD; then exit 0 fi -/run/current-system/sw/bin/nix flake check /home/synchronous/nix-cfg/ || { echo "Flake check failed. Exiting."; exit 1; } +# /run/current-system/sw/bin/nix flake check /home/synchronous/nix-cfg/ || { echo "Flake check failed. Exiting."; exit 1; } # Autoformat your nix files alejandra . &>/dev/null \ @@ -34,8 +34,10 @@ git status --porcelain echo "" echo "NixOS Rebuilding..." +prev=$(basename $(readlink /run/current-system) | sed 's/.*nixos-system-\(.*\)-.*$/\1/') + # Rebuild, output simplified errors, log trackebacks -sudo /run/current-system/sw/bin/nixos-rebuild switch --flake /home/synchronous/nix-cfg/flake.nix 2>&1 | tee /tmp/nixos-switch.log +sudo /run/current-system/sw/bin/nixos-rebuild switch --flake /home/synchronous/nix-cfg/flake.nix#"$prev" 2>&1 | tee /tmp/nixos-switch.log # cat /tmp/nixos-switch.log | grep --color error && exit 1 diff --git a/home/scripts/res.sh b/home/scripts/res.sh new file mode 100644 index 0000000..a0b39f1 --- /dev/null +++ b/home/scripts/res.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +export SCREEN_RES=$(xrandr | grep "*" | awk '{print $1}') diff --git a/home/services/services.nix b/home/services/services.nix index 921dcc6..f721d3c 100644 --- a/home/services/services.nix +++ b/home/services/services.nix @@ -6,6 +6,6 @@ imports = [ ./picom/default.nix ./dunst/default.nix - ./gpg-agent/default.nix + # ./gpg-agent/default.nix ]; } diff --git a/home/test.tex b/home/test.tex deleted file mode 100644 index e69de29..0000000 diff --git a/hosts/thonkpad/configuration.nix b/hosts/thonkpad/configuration.nix new file mode 100644 index 0000000..3eae7e4 --- /dev/null +++ b/hosts/thonkpad/configuration.nix @@ -0,0 +1,263 @@ +{ + config, + pkgs, + lib, + ... +}: let + pkg_with_working_nitrogen = import (builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/c0c50dfcb70d48e5b79c4ae9f1aa9d339af860b4.tar.gz"; + sha256 = "17p3w4mgfr4yj2p0jz6kqgzhyr04h4fap5hnd837664xd1xhwdjb"; + }) {inherit (pkgs) system;}; + + old-nitrogen = pkg_with_working_nitrogen.nitrogen; +in { + imports = [ + ./hardware-configuration.nix + ../../system/system.nix + ]; + + options.res = lib.mkOption { + type = lib.types.str; + default = "1920x1080"; + description = "screen resolution"; + }; + + options.zsh_remote = lib.mkOption { + type = lib.types.str; + default = "1920x1080"; + description = "zsh remote secret"; + }; + + config = { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "hm-backup"; + # sharedModules = [agenix.homeManagerModules.default]; + # extraSpecialArgs = {inherit (config);}; + # users.synchronous.imports = [ + # ({ + # config, + # lib, + # ... + # }: + # import ../../home/home.nix { + # inherit config pkgs lib; + # }) + # ]; + users.synchronous.imports = [../../home/home.nix]; + }; + + res = "1366x768"; + age = { + secrets.zsh_remote = { + file = ../../secrets/zsh_remote.age; + owner = "synchronous"; + mode = "0400"; + }; + secretsDir = "/home/synchronous/.agenix/agenix"; + secretsMountPoint = "/home/synchronous/.agenix/agenix.d"; + identityPaths = ["/home/synchronous/.ssh/id_ed25519"]; + }; + + # config = { + # res = "1366x768"; + # }; + + # system.res = "1366x768"; + + # Bootloader. + # boot.loader.grub.enable = true; + # boot.loader.grub.device = "/dev/sda"; + # boot.loader.grub.useOSProber = true; + # boot.loader.grub.version = 2; + #boot = { + # loader.systemd-boot = { + # enable = true; + # editor = false; + # }; + # kernelPackages = pkgs.linuxPackages; + #}; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.grub.enable = false; + + networking.hostName = "thonkpad"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + nix = { + nixPath = [ + "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos" + "nixos-config=/home/synchronous/nix-cfg/configuration.nix" + "/nix/var/nix/profiles/per-user/root/channels" + ]; + + settings = { + experimental-features = ["nix-command" "flakes"]; + substituters = [ + "https://nix-community.cachix.org" + ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + }; + + # 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/New_York"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + hardware.bluetooth.enable = true; + programs.dconf.enable = true; + + # Enable sound with pipewire. + 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; + + users.users.synchronous = { + isNormalUser = true; + description = "jake"; + extraGroups = ["networkmanager" "wheel"]; + packages = with pkgs; [ + kdePackages.kate + # firefox + git + arandr + procs + htop + zsh + ripgrep + rofi + alacritty + python3 + tree + old-nitrogen + polybar + sxhkd + bspwm + # librewolf + eza + flameshot + neofetch + lolcat + nnn + xclip + brightnessctl + xbindkeys + pulseaudio + xorg.xf86inputsynaptics + libnotify # for notify-send + alejandra + discord + legcord + polybar-pulseaudio-control + bluez # polybar + zotero + texliveFull + texlivePackages.latexmk + nmap + procps # for pgrep + # xorg.xrandr + # thunderbird + ]; + }; + + security.sudo = { + # me ne frego. i dare you to privilege escalate me + enable = true; + extraRules = [ + { + commands = [ + { + command = "/etc/profiles/per-user/synchronous/bin/rebuild"; + options = ["NOPASSWD"]; + } + { + command = "/home/synchronous/nix-cfg/home/scripts/nixos-rebuild.sh"; + options = ["NOPASSWD"]; + } + { + command = "/home/synchronous/.scripts/nixos-rebuild.sh"; + options = ["NOPASSWD"]; + } + { + # are you serious? + command = "/run/current-system/sw/bin/nixos-rebuild switch --flake /home/synchronous/nix-cfg/flake.nix"; + options = ["NOPASSWD"]; + } + ]; + users = ["synchronous"]; + } + ]; + }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + vim + neovim + linux-manual + man-pages + man-pages-posix + fontconfig + python3 + rofi + flameshot + tree + # nitrogen + polybar + sxhkd + bspwm + # librewolf + ]; + + # 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 = "24.11"; # Did you read the comment? + }; +} diff --git a/hardware-configuration.nix b/hosts/thonkpad/hardware-configuration.nix similarity index 70% rename from hardware-configuration.nix rename to hosts/thonkpad/hardware-configuration.nix index afc3905..8988e1a 100644 --- a/hardware-configuration.nix +++ b/hosts/thonkpad/hardware-configuration.nix @@ -12,16 +12,22 @@ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"]; + boot.initrd.availableKernelModules = ["ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci"]; boot.initrd.kernelModules = []; boot.kernelModules = ["kvm-intel"]; boot.extraModulePackages = []; fileSystems."/" = { - device = "/dev/disk/by-uuid/05ca9d56-3506-43c5-b9ec-be928b782996"; + device = "/dev/disk/by-uuid/aa4ec46a-b4aa-4a7c-a016-7d6e224cd7ba"; fsType = "ext4"; }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/CCA5-0BDD"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; + swapDevices = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking @@ -29,8 +35,8 @@ # still possible to use this option, but it's recommended to use it in conjunction # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s25.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/nixos-switch.log b/nixos-switch.log deleted file mode 100644 index 5891e46..0000000 --- a/nixos-switch.log +++ /dev/null @@ -1,25 +0,0 @@ -warning: Path '/home/synchronous/nix-cfg/flake.nix' should point at the directory containing the 'flake.nix' file, not the file itself. Pretending that you meant '/home/synchronous/nix-cfg' -warning: Git tree '/home/synchronous/nix-cfg' is dirty -error: - … while calling the 'seq' builtin - at /nix/store/6zgbbqlr7nnfxpzkyj7fsl4fpg89jbw0-source/lib/modules.nix:334:18: - 333| options = checked options; - 334| config = checked (removeAttrs config [ "_module" ]); - | ^ - 335| _module = checked (config._module); - - … while evaluating a branch condition - at /nix/store/6zgbbqlr7nnfxpzkyj7fsl4fpg89jbw0-source/lib/modules.nix:273:9: - 272| checkUnmatched = - 273| if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then - | ^ - 274| let - - (stack trace truncated; use '--show-trace' to show the full, detailed trace) - - error: syntax error, unexpected ';' - at /nix/store/f06nazkwk5a29vz793alp0zppviacn27-source/configuration.nix:142:7: - 141| } - 142| ];;; - | ^ - 143| }; diff --git a/secrets/secrets.nix b/secrets/secrets.nix new file mode 100644 index 0000000..9d74b3f --- /dev/null +++ b/secrets/secrets.nix @@ -0,0 +1,6 @@ +# so yeah you gotta run `agenix -e secret.age` to actually edit a secret +let + key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEw4Uqg9UBakoOpS4nVGE3ePKHnst0+02lFN04n2IyKb ginesin.j@northeastern.edu"; +in { + "zsh_remote.age".publicKeys = [key]; +} diff --git a/secrets/zsh_remote.age b/secrets/zsh_remote.age new file mode 100644 index 0000000..a46d646 Binary files /dev/null and b/secrets/zsh_remote.age differ diff --git a/system/hardware/configuration/hardware-configuration.nix b/system/hardware/configuration/hardware-configuration.nix index afc3905..8988e1a 100644 --- a/system/hardware/configuration/hardware-configuration.nix +++ b/system/hardware/configuration/hardware-configuration.nix @@ -12,16 +12,22 @@ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"]; + boot.initrd.availableKernelModules = ["ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci"]; boot.initrd.kernelModules = []; boot.kernelModules = ["kvm-intel"]; boot.extraModulePackages = []; fileSystems."/" = { - device = "/dev/disk/by-uuid/05ca9d56-3506-43c5-b9ec-be928b782996"; + device = "/dev/disk/by-uuid/aa4ec46a-b4aa-4a7c-a016-7d6e224cd7ba"; fsType = "ext4"; }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/CCA5-0BDD"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; + swapDevices = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking @@ -29,8 +35,8 @@ # still possible to use this option, but it's recommended to use it in conjunction # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s25.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/system/hardware/hardware.nix b/system/hardware/hardware.nix index b82e1c4..360ac8d 100644 --- a/system/hardware/hardware.nix +++ b/system/hardware/hardware.nix @@ -4,7 +4,7 @@ ... }: { imports = [ - ./configuration/hardware-configuration.nix + # ./configuration/hardware-configuration.nix ./power-management/default.nix ]; } diff --git a/system/xserver/default.nix b/system/xserver/default.nix index d6c8257..37be12d 100644 --- a/system/xserver/default.nix +++ b/system/xserver/default.nix @@ -4,51 +4,29 @@ ... }: { # services.xserver.dpi = 180; + # services.dbus.enable = true; + security.polkit.enable = true; services.xserver = { enable = true; xkb.layout = "us"; xkb.variant = ""; - # displayManager.defaultSession = "bspwm"; + displayManager.defaultSession = "none+bspwm"; desktopManager.xterm.enable = false; windowManager.bspwm.enable = true; - # windowManager.bspwm = { - # enable = true; - # # extraConfig = builtins.readFile ./bspwmrc; - # # configFile = ./bspwmrc; # relative import to preserve locality of config - # # package = "bspwm-unstable"; - # # sxhkd.package = "sxhkd-unstable"; - # # sxhkd.configFile = ./sxhkdrc; - # }; - displayManager = { # autoLogin.user = "synchronous"; # autoLogin.enable = true; - lightdm = { + # lightdm = { + # enable = true; + # greeters.gtk.enable = true; + # }; + sddm = { enable = true; - greeters.gtk.enable = true; }; }; }; - - # xsession.windowManager.bspwm = { - # enable = true; - # extraConfig = builtins.readFile ./bspwmrc; - # }; - - # services.sxhkd.enable = true; - # services.sxhkd.extraConfig = builtins.readFile ./sxhkdrc; - - # services.displayManager.autoLogin.enable = true; - - # services.displayManagrer.sddm.enable = true; - # services.desktopManager.plasma6.enable = true; - - # services.xserver.xkb = { - # layout = "us"; - # variant = ""; - # } }