diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2024-01-31 22:02:28 +0530 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2024-01-31 22:02:28 +0530 |
| commit | 01bb0877c285383fd2857920048bd2576f4d31e9 (patch) | |
| tree | b6f26596f1051baf5b791450d6158a69363f6c76 | |
| parent | 578dd91bd1af79b256166ecf797344611790e267 (diff) | |
restructure
| -rw-r--r-- | config/.fdignore (renamed from .fdignore) | 0 | ||||
| -rw-r--r-- | config/.tmux.conf (renamed from .tmux.conf) | 0 | ||||
| -rw-r--r-- | config/alacritty/default.nix | 11 | ||||
| -rw-r--r-- | config/themes.nix | 25 | ||||
| -rw-r--r-- | configuration.nix | 38 | ||||
| -rw-r--r-- | desktop.nix | 72 | ||||
| -rw-r--r-- | flake.lock | 48 | ||||
| -rw-r--r-- | flake.nix | 28 | ||||
| -rw-r--r-- | hardware-configuration.nix | 38 | ||||
| -rw-r--r-- | home.nix | 142 | ||||
| -rw-r--r-- | machines/z/configuration.nix | 26 | ||||
| -rw-r--r-- | machines/z/hardware-configuration.nix | 27 | ||||
| -rw-r--r-- | machines/z/home.nix | 20 | ||||
| -rw-r--r-- | modules/compromyse.nix | 10 | ||||
| -rw-r--r-- | modules/global.nix | 12 | ||||
| -rw-r--r-- | modules/nvidia.nix (renamed from OwO.nix) | 13 | ||||
| -rw-r--r-- | modules/ssh.nix | 9 |
17 files changed, 217 insertions, 302 deletions
diff --git a/.fdignore b/config/.fdignore index 44ba588..44ba588 100644 --- a/.fdignore +++ b/config/.fdignore diff --git a/.tmux.conf b/config/.tmux.conf index 94169b0..94169b0 100644 --- a/.tmux.conf +++ b/config/.tmux.conf diff --git a/config/alacritty/default.nix b/config/alacritty/default.nix new file mode 100644 index 0000000..af272ef --- /dev/null +++ b/config/alacritty/default.nix @@ -0,0 +1,11 @@ +{ pkgs, config, ... }: + +{ + programs.git = { + enable = true; + userName = "Raghuram Subramani"; + userEmail = "raghus2247@gmail.com"; + }; + + programs.alacritty.enable = true; +} diff --git a/config/themes.nix b/config/themes.nix new file mode 100644 index 0000000..a0b20f5 --- /dev/null +++ b/config/themes.nix @@ -0,0 +1,25 @@ +{ home, pkgs, ... }: + +{ + home.pointerCursor = { + gtk.enable = true; + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Classic"; + size = 16; + }; + + gtk = { + enable = true; + + theme = { name = "adw-gtk3-dark"; package = pkgs.adw-gtk3; }; + iconTheme = { name = "Papirus-Dark"; package = pkgs.papirus-icon-theme; }; + + font = { name = "UbuntuMono Nerd Font"; }; + }; + + qt = { + enable = true; + platformTheme = "gtk"; + style.name = "adwaita-dark"; + }; +} diff --git a/configuration.nix b/configuration.nix deleted file mode 100644 index 9c0e07d..0000000 --- a/configuration.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ config, pkgs, ... }: - -{ - imports = [ - ./hardware-configuration.nix - ./OwO.nix - ./home.nix - ./desktop.nix - ]; - - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - nixpkgs.config.allowUnfree = true; - - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - environment.systemPackages = with pkgs; [ - waybar - fuzzel - dunst - hyprpaper - swaylock - - networkmanagerapplet - - greetd.tuigreet - greetd.greetd - polkit_gnome - - libnotify - libappindicator - - cudatoolkit - ]; - - system.stateVersion = "23.11"; -} - diff --git a/desktop.nix b/desktop.nix deleted file mode 100644 index ab00242..0000000 --- a/desktop.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ config, pkgs, ... }: - -{ - programs.hyprland = { - enable = true; - xwayland.enable = true; - }; - xdg.portal.enable = true; - xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-hyprland ]; - - environment.sessionVariables = { - NIXOS_OZONE_WL = "1"; - }; - - services.printing.enable = true; - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; - - networking.networkmanager.enable = true; - - hardware.bluetooth.enable = true; - hardware.bluetooth.powerOnBoot = true; - services.blueman.enable = true; - - services.xserver.libinput.enable = true; - services.greetd = { - enable = true; - settings = { - default_session = { - command = "tuigreet --time --remember --cmd Hyprland"; - user = "greeter"; - }; - }; - }; - - services.logind.extraConfig = '' - HandlePowerKey=ignore - ''; - - systemd.services.greetd.serviceConfig = { - Type = "idle"; - StandardInput = "tty"; - StandardOutput = "tty"; - StandardError = "journal"; - TTYReset = true; - TTYVHangup = true; - TTYVTDisallocate = true; - }; - - security.polkit.enable = true; - security.pam.services.swaylock.text = '' - auth include login - ''; - - programs.gnupg.agent = { - enable = true; - }; - - programs.dconf.enable = true; - - fonts.packages = with pkgs; [ - (nerdfonts.override { fonts = [ "UbuntuMono" ]; }) - ]; -} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..067fcfa --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1706473109, + "narHash": "sha256-iyuAvpKTsq2u23Cr07RcV5XlfKExrG8gRpF75hf1uVc=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "d634c3abafa454551f2083b054cd95c3f287be61", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1706550542, + "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1ea7430 --- /dev/null +++ b/flake.nix @@ -0,0 +1,28 @@ +{ + description = "Nix Configuration"; + + inputs = { + # Nixpkgs + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + + # Home manager + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, ... }@inputs: { + # nixos-rebuild --flake .#machine + nixosConfigurations = { + z = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./machines/z/configuration.nix + inputs.home-manager.nixosModules.default + ]; + }; + }; + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix deleted file mode 100644 index 4618943..0000000 --- a/hardware-configuration.nix +++ /dev/null @@ -1,38 +0,0 @@ -# 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" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/347f3061-af46-40c7-aae3-fd4546cebb24"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/03DC-FCFF"; - fsType = "vfat"; - }; - - swapDevices = [ ]; - - # 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.wlp0s20f3.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/home.nix b/home.nix deleted file mode 100644 index cda4cd3..0000000 --- a/home.nix +++ /dev/null @@ -1,142 +0,0 @@ -{ config, pkgs, ... }: -let - home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; -in -{ - imports = [ - (import "${home-manager}/nixos") - ]; - - users.users.compromyse = { - isNormalUser = true; - extraGroups = [ "wheel" "storage" "libvirtd" ]; - }; - - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; - - home-manager.users.compromyse = { pkgs, ... }: { - home.packages = with pkgs; [ - wget - - tmux - fzf - fd - ripgrep - - cinnamon.nemo - mate.eom - - spotify - firefox - - obs-studio - - pavucontrol - blueman - brillo - ]; - - programs.bash = { - enable = true; - initExtra= '' - export PS1="\[\e[38;5;243m\]\h \[\e[38;5;254m\]\w \[\033[0m\]> " - set -o vi - - if [[ -n "$IN_NIX_SHELL" ]]; then - export PS1="\[\e[38;5;242m\](dev) $PS1" - fi - - sessionizer() { - DIR=$(fd . /data --type d -L -H | fzf) - SESSION_NAME="$DIR_$(date +%M%S)" - - if [ -n "$DIR" ] - then - if [ "$1" == "-cd" ] - then - cd $DIR - return - fi - tmux new-session -d -c "$DIR" -s "$SESSION_NAME" - if [ -n "$TMUX" ] - then - tmux switch -t "$SESSION_NAME" - else - tmux attach -t "$SESSION_NAME" - fi - fi - } - - if [[ $- != *i* ]] - then - sessionizer - fi - - bind '"\C-f": "sessionizer\n"' - bind '"\C-a": "sessionizer -cd\n"' - ''; - }; - - programs.git = { - enable = true; - userName = "Raghuram Subramani"; - userEmail = "raghus2247@gmail.com"; - }; - - programs.neovim = { - enable = true; - defaultEditor = true; - viAlias = true; - vimAlias = true; - vimdiffAlias = true; - }; - - - programs.alacritty = { - enable = true; - }; - - home.file = { - ".tmux.conf".source = ./.tmux.conf; - ".fdignore".source = ./.fdignore; - ".config" = { - source = ./config; - recursive = true; - }; - }; - - home.pointerCursor = { - gtk.enable = true; - package = pkgs.bibata-cursors; - name = "Bibata-Modern-Classic"; - size = 16; - }; - - gtk = { - enable = true; - - theme = { name = "adw-gtk3-dark"; package = pkgs.adw-gtk3; }; - iconTheme = { name = "Papirus-Dark"; package = pkgs.papirus-icon-theme; }; - - font = { name = "UbuntuMono Nerd Font"; }; - }; - - qt = { - enable = true; - platformTheme = "gtk"; - style.name = "adwaita-dark"; - }; - - home.stateVersion = "23.11"; - }; - - environment.etc."inputrc".text = pkgs.lib.mkForce ( - builtins.readFile <nixpkgs/nixos/modules/programs/bash/inputrc> + '' - set completion-ignore-case on - '' - ); - - virtualisation.libvirtd.enable = true; - programs.virt-manager.enable = true; -} diff --git a/machines/z/configuration.nix b/machines/z/configuration.nix new file mode 100644 index 0000000..5af5c58 --- /dev/null +++ b/machines/z/configuration.nix @@ -0,0 +1,26 @@ +{ lib, inputs, ... }: + +{ + imports = [ + ./hardware-configuration.nix + inputs.home-manager.nixosModules.default + ] ++ (map (path: ../../modules/${path}) [ + "global.nix" + "compromyse.nix" + ]); + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.efi.efiSysMountPoint = "/boot/efi"; + + boot.extraModprobeConfig = "options kvm_intel nested=1"; + + fileSystems."/data" = { + device = "/dev/sda"; + fsType = "ext4"; + }; + + networking.hostName = "z"; + + home-manager.users.compromyse = import ./home.nix; +} diff --git a/machines/z/hardware-configuration.nix b/machines/z/hardware-configuration.nix new file mode 100644 index 0000000..aeb8272 --- /dev/null +++ b/machines/z/hardware-configuration.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/347f3061-af46-40c7-aae3-fd4546cebb24"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/03DC-FCFF"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/machines/z/home.nix b/machines/z/home.nix new file mode 100644 index 0000000..564d4d5 --- /dev/null +++ b/machines/z/home.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: + +{ + + home = { + username = "compromyse"; + homeDirectory = "/home/compromyse"; + }; + + imports = [ + ../../config/themes.nix + ../../config/alacritty + ]; + + home.packages = with pkgs; [ + wget + ]; + + home.stateVersion = "23.11"; +} diff --git a/modules/compromyse.nix b/modules/compromyse.nix new file mode 100644 index 0000000..0d204d2 --- /dev/null +++ b/modules/compromyse.nix @@ -0,0 +1,10 @@ +{ config, ... }: + +{ + users.users.compromyse = { + initialPassword = "changeme"; + isNormalUser = true; + # openssh.authorizedKeys.keys = []; + extraGroups = [ "wheel" "storage" "libvirtd" ]; + }; +} diff --git a/modules/global.nix b/modules/global.nix new file mode 100644 index 0000000..61575c1 --- /dev/null +++ b/modules/global.nix @@ -0,0 +1,12 @@ +{ + nix.settings = { + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + }; + + nixpkgs.config.allowUnfree = true; + + time.timeZone = "Asia/Kolkata"; + + system.stateVersion = "23.11"; +} diff --git a/OwO.nix b/modules/nvidia.nix index f57f2c6..a3f6074 100644 --- a/OwO.nix +++ b/modules/nvidia.nix @@ -1,10 +1,6 @@ -{ config, pkgs, ... }: +{ pkgs, config, ... }: { - boot.extraModprobeConfig = "options kvm_intel nested=1"; - - networking.hostName = "OwO"; - hardware.opengl = { enable = true; driSupport = true; @@ -26,11 +22,4 @@ nvidiaBusId = "PCI:1:0:0"; }; }; - - fileSystems."/data" = { - device = "/dev/sda"; - fsType = "ext4"; - }; - - time.timeZone = "Asia/Kolkata"; } diff --git a/modules/ssh.nix b/modules/ssh.nix new file mode 100644 index 0000000..a389210 --- /dev/null +++ b/modules/ssh.nix @@ -0,0 +1,9 @@ +{ pkgs, config, ... }: + +{ + services.openssh = { + enable = true; + permitRootLogin = "no"; + passwordAuthentication = false; + }; +} |
