diff options
| author | Kumar Damani <me@kumardamani.net> | 2024-04-20 22:19:47 +0000 |
|---|---|---|
| committer | Kumar Damani <me@kumardamani.net> | 2024-04-20 22:19:47 +0000 |
| commit | 773fe01e4740b20e74a74eeacf68040a604142a8 (patch) | |
| tree | c0da66dd823fe5da17b02fbd2364b4b3872eb001 | |
| parent | 1bdfda4a417ec5c15f8e1b58c9c718feba326e0a (diff) | |
new machine
5 files changed, 558 insertions, 0 deletions
diff --git a/nixpkgs/.config/nixpkgs/flake.nix b/nixpkgs/.config/nixpkgs/flake.nix index e938509..790d290 100644 --- a/nixpkgs/.config/nixpkgs/flake.nix +++ b/nixpkgs/.config/nixpkgs/flake.nix @@ -26,6 +26,21 @@ } ]; }; + "art" = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./per-user/kdam0-art/configuration.nix + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.kdam0 = import ./per-user/kdam0-art/home.nix; + + # Optionally, use home-manager.extraSpecialArgs to pass + # arguments to home.nix + } + ]; + }; }; # Home Manager Only diff --git a/nixpkgs/.config/nixpkgs/per-user/kdam0-art/configuration.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-art/configuration.nix new file mode 100644 index 0000000..b9a6628 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-art/configuration.nix @@ -0,0 +1,148 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./hosts.nix + ]; + + # Use the GRUB 2 boot loader. + boot.loader.grub.enable = true; + # boot.loader.grub.efiSupport = true; + # boot.loader.grub.efiInstallAsRemovable = true; + # boot.loader.efi.efiSysMountPoint = "/boot/efi"; + # Define on which hard drive you want to install Grub. + boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only + + networking.hostName = "art"; # Define your hostname. + # Pick only one of the below networking options. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + + # Set your time zone. + time.timeZone = "America/Toronto"; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + #keyMap = "us"; + useXkbConfig = true; # use xkb.options in tty. + }; + + # Enable the X11 windowing system. + # services.xserver.enable = true; + + # Configure keymap in X11 + # services.xserver.xkb.layout = "us"; + # services.xserver.xkb.options = "eurosign:e,caps:escape"; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound. + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + wireplumber.enable = true; + # media-session.enable = false; + jack.enable = true; + systemWide = false; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.kdam0 = { + isNormalUser = true; + extraGroups = [ + "wheel" + "networkmanager" + "audio" + "video" + ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + tree + ]; + shell = pkgs.zsh; + }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + neovim + wget + git + rsync + htop + bmon + alsa-utils + ]; + + # 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; + + security.pam.services = { + login.gnupg.enable = true; + }; + + programs.zsh.enable = true; + programs.hyprland.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + networking.firewall.enable = false; + + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "23.11"; # Did you read the comment? + + system.autoUpgrade.enable = true; + system.autoUpgrade.allowReboot = true; + + nix.settings.experimental-features = ["nix-command" "flakes"]; + nix.settings.auto-optimise-store = true; +} + diff --git a/nixpkgs/.config/nixpkgs/per-user/kdam0-art/hardware-configuration.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-art/hardware-configuration.nix new file mode 100644 index 0000000..2168526 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-art/hardware-configuration.nix @@ -0,0 +1,35 @@ +# 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 = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ config.boot.kernelPackages.rtl8821au ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/4d71526e-b296-49a2-ab2b-3c7a2c970f83"; + fsType = "ext4"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/7f4fb8f6-2fac-4b0e-8ed5-7d30e492545b"; } + ]; + + # 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.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/nixpkgs/.config/nixpkgs/per-user/kdam0-art/home.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-art/home.nix new file mode 100644 index 0000000..dcb4564 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-art/home.nix @@ -0,0 +1,351 @@ +{ config, pkgs, libs, ...}: +{ + home.username = "kdam0"; + home.homeDirectory = "/home/kdam0"; + home.sessionPath = [ + "$HOME/.config/nixpkgs/common/scripts" + ]; + home.sessionVariables = { + EDITOR = "nvim"; + TERM = "xterm-256color"; + }; + home.shellAliases = { + l = "ls -l"; + ll = "ls -al"; + ".." = "cd .."; + v = "nvim $@"; + r = "ranger $@"; + gst = "git status"; + chm = "nvim ~/.config/nixpkgs/per-user/kdam0-art/home.nix"; + cvim = "nvim ~/.config/nixpkgs/common/nvim/init.vim"; + clsp = "nvim ~/.config/nixpkgs/common/nvim/plugins/lspconfig.lua"; + search = "nix search nixpkgs $@"; + conf = "ranger ~/.config/nixpkgs/common/"; + up = "cd ~/.config/nixpkgs; sudo nixos-rebuild switch --flake ."; + #up = "sudo nixos-rebuild switch"; + }; + + programs.home-manager.enable = true; + programs.zsh = { + enable = true; + defaultKeymap = "viins"; + initExtra = '' + source ${config.home.homeDirectory}/.p10k.zsh + bindkey '^ ' autosuggest-accept + ''; + zplug = { + enable = true; + plugins = [ + { name = "zsh-users/zsh-autosuggestions"; } + { name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } + ]; + }; + }; + programs.tmux = { + enable = true; + clock24 = true; + shell = "${pkgs.zsh}/bin/zsh"; + prefix = "C-a"; + terminal = "screen-256color"; + keyMode = "vi"; + plugins = with pkgs; [ + tmuxPlugins.sensible + { + plugin = tmuxPlugins.resurrect; + extraConfig = "set -g @resurrect-strategy-nvim 'session'"; + } + tmuxPlugins.pain-control + tmuxPlugins.yank + ]; + sensibleOnTop = true; + }; + programs.git = { + enable = true; + userName = "Kumar Damani"; + userEmail = "me@kumardamani.net"; + aliases = { + lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; + }; + }; + programs.neovim = { + enable = true; + withPython3 = false; + withRuby = true; + withNodeJs = true; + vimdiffAlias = true; + plugins = with pkgs.vimPlugins; [ + tokyonight-nvim + nvim-treesitter.withAllGrammars + nvim-autopairs + nvim-cmp + cmp-buffer + cmp-path + nvim-web-devicons + nnn-vim + luasnip + cmp_luasnip + cmp-nvim-lsp + friendly-snippets + { + plugin = indent-blankline-nvim-lua; + type = "lua"; + config = builtins.readFile(../../common/nvim/plugins/indent-blankline.lua); + } + { + plugin = lualine-nvim; + type = "lua"; + config = builtins.readFile(../../common/nvim/plugins/lualine.lua); + } + { + plugin = trouble-nvim; + type = "lua"; + config = builtins.readFile(../../common/nvim/plugins/trouble.lua); + } + { + plugin = telescope-nvim; + type = "lua"; + config = builtins.readFile(../../common/nvim/plugins/telescope.lua); + } + telescope-fzf-native-nvim + { + plugin = leap-nvim; + type = "lua"; + config = builtins.readFile(../../common/nvim/plugins/leap.lua); + } + mason-nvim + mason-lspconfig-nvim + neoconf-nvim + { + plugin = nvim-lspconfig; + type = "lua"; + config = builtins.readFile(../../common/nvim/plugins/lspconfig.lua); + } + ]; + extraConfig = builtins.readFile ../../common/nvim/init.vim; + }; + programs.fzf = { + enable = true; + tmux.enableShellIntegration = true; + }; + programs.direnv = { + enable = true; + enableZshIntegration = true; # see note on other shells below + nix-direnv.enable = true; + }; + + programs.waybar.enable = true; + + + home.stateVersion = "22.11"; + nixpkgs = { + config = { + allowUnfree = true; + allowUnfreePredicate = (_: true); + }; + }; + home.packages = with pkgs; [ + # Window environment + xdg-desktop-portal-hyprland + foot + wl-clipboard + wf-recorder + grimblast + wbg + # Browsers + firefox + brave + # File Managers + ranger + nnn + # Fonts + noto-fonts + noto-fonts-emoji + noto-fonts-monochrome-emoji + nerdfonts + hack-font + font-awesome + # Notifications + mako + libnotify + # Image viewer + imv + # Video player + mpv + # Pdf Viewer + zathura + # Power stuff + acpi + # Other stuff + entr + gnumake + neofetch + trash-cli + nextcloud-client + ripgrep + fd + stow + unzip + nodejs + cargo + wget + lazygit + signal-desktop + wev + sshpass + libreoffice + drawio + virt-viewer + dig + dnsutils + s3fs + jq + publii + thunderbird + wofi + pavucontrol + ]; + + fonts.fontconfig.enable = true; + + services.gpg-agent = { + enable = true; + defaultCacheTtl = 1800; + enableSshSupport = true; + }; + + systemd.user.services = { + bg-wallpaper = { + Unit = { + Description = "Auto refresh wallpaper"; + After = "network-online.target"; + }; + Service = { + Type = "simple"; + ExecStart = "${config.home.homeDirectory}/.config/nixpkgs/common/scripts/walp"; + TimeoutStopSec = "10"; + KillMode = "process"; + KillSignal = "SIGKILL"; + }; + Install.WantedBy = ["multi-user.target"]; + }; + }; + systemd.user.timers = { + bg-wallpaper = { + Unit.Description = "Automatic update of wallpaper"; + Timer.OnUnitActiveSec = "10min"; + Install.WantedBy = ["multi-user.target" "timers.target"]; + }; + }; + systemd.user.startServices = true; + + wayland.windowManager.hyprland = { + enable = true; + settings = { + "$mod" = "ALT"; + input = { + "kb_options" = "caps:swapescape"; + }; + monitor = [ + "DP-1, 1920x1080@60, 0x0,1" + ", preferred,auto,1" + ]; + workspace = [ + "1,monitor:eDP-1" + "2,monitor:DP-1" + "3,monitor:DP-1" + "4,monitor:DP-1" + "5,monitor:DP-1" + "6,monitor:DP-1" + "7,monitor:DP-1" + "8,monitor:DP-1" + "9,monitor:DP-1" + "10,monitor:DP-1" + ]; + windowrulev2 = [ + "workspace 9,class:^firefox$" + "workspace 8,class:^Brave(.*)$" + "workspace 7,class:^remote-viewer$" + "workspace 1,class:^Slack$" + "workspace 1,class:^Signal$" + ]; + animation = [ + "workspaces,1,2,default" + "windows,1,3,default" + "fade,0" + ]; + bind = [ + "$mod, j, cyclenext, prev" + "$mod Shift, j, swapnext, prev" + "$mod, k, cyclenext," + "$mod Shift, k, swapnext," + "$mod Shift, l, exec, swaylock -i /tmp/bg" + "$mod, period, focusmonitor, +1" + "$mod, Tab, workspace, previous" + "$mod, escape, workspace, m-1" + "$mod, semicolon, workspace, m+1" + "$mod, q, killactive" + "$mod, Return, exec, foot" + "$mod, p, exec, wofi --show run" + "$mod, r, exec, foot -e ranger" + ", Delete, exec, grimblast copy area" + "Shift, Delete, exec, GRIMBLAST_EDITOR=pinta grimblast edit area" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} + builtins.concatLists (builtins.genList ( + x: let + ws = let + c = (x + 1) / 10; + in + builtins.toString (x + 1 - (c * 10)); + in [ + "$mod, ${ws}, workspace, ${toString (x + 1)}" + "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" + ] + ) + 10) + ); + binde = [ + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+" + ", XF86MonBrightnessDown, exec, light -U 10" + ", XF86MonBrightnessUp, exec, light -A 10" + "$mod, h, resizeactive, -20 20" + "$mod, l, resizeactive, 20 -20" + ]; + bindm = [ + "$mod,mouse:272,movewindow" + "$mod,mouse:273,resizewindow" + ]; + binds = { + "allow_workspace_cycles" = true; + }; + "exec-once" = [ + "mako" + "walp" + "waybar" + "[workspace 9 silient] firefox" + "[workspace 8 silient] brave" + "[workspace 2 silent] foot" + "[workspace 1 silient] slack" + "[workspace 1 silient] signal-desktop" + ]; + }; + }; + + + # Source app specific configs + home.file.".config/foot/foot.ini".source = ../../common/foot/foot.ini; + home.file.".config/wofi/style.css".source = ../../common/wofi/style.css; + home.file.".config/mako/config".source = ../../common/mako/config; + home.file.".local/share/fonts".source = ../../common/fonts; + home.file.".config/waybar".source = ../../common/waybar; + #home.file.".config/way-displays".source = ../../common/way-displays; + + #home.file.".config/foot/foot.ini".text = '' + #[colors] + #alpha=0.7 + #''; +} diff --git a/nixpkgs/.config/nixpkgs/per-user/kdam0-art/hosts.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-art/hosts.nix new file mode 100644 index 0000000..8f21ea8 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-art/hosts.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ networking.extraHosts = '' +# Your /etc/hosts entries go here +127.0.0.2 other-localhost + +192.168.0.87 art-jr +''; +} |
