commit 2dca39131a8dca7b3ddee6f836828a9ec681c038 Author: Crony Akatsuki Date: Tue Jan 28 15:00:09 2025 +0100 Basic configuration. diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..5d3d931 --- /dev/null +++ b/flake.lock @@ -0,0 +1,401 @@ +{ + "nodes": { + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1732200724, + "narHash": "sha256-+R1BH5wHhfnycySb7Sy5KbYEaTJZWm1h+LW1OtyhiTs=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "153d52373b0fb2d343592871009a286ec8837aec", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1622559957, + "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1736852337, + "narHash": "sha256-esD42YdgLlEh7koBrSqcT7p2fsMctPAcGl/+2sYJa2o=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "03860521c40b0b9c04818f2218d9cc9efc21e7a5", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1732806396, + "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + } + }, + "firefox-gnome-theme": { + "flake": false, + "locked": { + "lastModified": 1736899990, + "narHash": "sha256-S79Hqn2EtSxU4kp99t8tRschSifWD4p/51++0xNWUxw=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "91ca1f82d717b02ceb03a3f423cbe8082ebbb26d", + "type": "github" + }, + "original": { + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": [ + "stylix", + "systems" + ] + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "stylix", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1735882644, + "narHash": "sha256-3FZAG+pGt3OElQjesCAWeMkQ7C/nB1oTHLRQ8ceP110=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "a5a961387e75ae44cc20f0a57ae463da5e959656", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "stylix", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1732369855, + "narHash": "sha256-JhUWbcYPjHO3Xs3x9/Z9RuqXbcp5yhPluGjwsdE2GMg=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "dadd58f630eeea41d645ee225a63f719390829dc", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "47.2", + "repo": "gnome-shell", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1737968762, + "narHash": "sha256-xiPARGKwocaMtv+U/rgi+h2g56CZZEmrcl7ldRaslq8=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "e1ae908bcc30af792b0bb0a52e53b03d2577255e", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1736785676, + "narHash": "sha256-TY0jUwR3EW0fnS0X5wXMAVy6h4Z7Y6a3m+Yq++C9AyE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "fc52a210b60f2f52c74eac41a8647c1573d2071d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1737885589, + "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1736798957, + "narHash": "sha256-qwpCtZhSsSNQtK4xYGzMiyEDhkNzOCz/Vfu4oL2ETsQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9abb87b552b7f55ac8916b6fc9e5cb486656a2f3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "stylix": "stylix" + } + }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-helix": "base16-helix", + "base16-vim": "base16-vim", + "firefox-gnome-theme": "firefox-gnome-theme", + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "git-hooks": "git-hooks", + "gnome-shell": "gnome-shell", + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs_2", + "systems": "systems", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" + }, + "locked": { + "lastModified": 1738025638, + "narHash": "sha256-nU3JpvIeEmcDHzQK4OTD1KXSoL/GOff6j9kuSO4X8eM=", + "owner": "danth", + "repo": "stylix", + "rev": "55418e8fc8d4696af619176a22cefcfac56ad2ef", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "stylix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tinted-foot": { + "flake": false, + "locked": { + "lastModified": 1726913040, + "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + } + }, + "tinted-kitty": { + "flake": false, + "locked": { + "lastModified": 1716423189, + "narHash": "sha256-2xF3sH7UIwegn+2gKzMpFi3pk5DlIlM18+vj17Uf82U=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1735737224, + "narHash": "sha256-FO2hRBkZsjlIRqzNHCPc/52yxg11kHGA8MEtSun9RwE=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "aead506a9930c717ebf81cc83a2126e9ca08fa64", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1725758778, + "narHash": "sha256-8P1b6mJWyYcu36WRlSVbuj575QWIFZALZMTg5ID/sM4=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "122c9e5c0e6f27211361a04fae92df97940eccf9", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1650b89 --- /dev/null +++ b/flake.nix @@ -0,0 +1,27 @@ +{ + description = "Nixos config flake"; + + inputs = { + # Use unstable packages ( which are amazing ) + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + + # YEI, HOME MANAGER + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + # Let's theme everything easilly + stylix.url = "github:danth/stylix"; + }; + + outputs = { self, nixpkgs, home-manager, ... }@inputs: { + nixosConfigurations.default = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs;}; + modules = [ + ./hosts/default/configuration.nix + inputs.stylix.nixosModules.stylix + ]; + }; + }; +} diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix new file mode 100644 index 0000000..b07c7e2 --- /dev/null +++ b/hosts/default/configuration.nix @@ -0,0 +1,186 @@ +{ config, pkgs, inputs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + inputs.home-manager.nixosModules.home-manager + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Get nicer hostname + networking.hostName = "nixos"; # Define your hostname. + + # Enable flakes + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # Setup gpu + hardware.graphics = { + enable = true; + enable32Bit = true; + }; + + # Allow for nvidia + services.xserver.videoDrivers = [ "nvidia" ]; + hardware.nvidia.open = true; # Set to false for proprietary drivers + hardware.nvidia.modesetting.enable = true; + hardware.nvidia.powerManagement.enable = true; + hardware.nvidia.nvidiaSettings = true; + hardware.nvidia.prime = { + offload = { + enableOffloadCmd = true; + enable = true; + }; + + nvidiaBusId = "PCI:1:0:0"; + amdgpuBusId = "PCI:5:0:0"; + }; + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "Europe/Zagreb"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "hr_HR.UTF-8"; + LC_IDENTIFICATION = "hr_HR.UTF-8"; + LC_MEASUREMENT = "hr_HR.UTF-8"; + LC_MONETARY = "hr_HR.UTF-8"; + LC_NAME = "hr_HR.UTF-8"; + LC_NUMERIC = "hr_HR.UTF-8"; + LC_PAPER = "hr_HR.UTF-8"; + LC_TELEPHONE = "hr_HR.UTF-8"; + LC_TIME = "hr_HR.UTF-8"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the KDE Plasma Desktop Environment. + services.displayManager.sddm.enable = true; + services.desktopManager.plasma6.enable = true; + environment.plasma6.excludePackages = with pkgs.kdePackages; [ + plasma-browser-integration + konsole + oxygen + ]; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + options = "caps:escape"; + }; + + # Enable sound with pipewire. + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.crony = { + isNormalUser = true; + description = "Crony"; + extraGroups = [ "networkmanager" "wheel" "video" "input" "audio" "libvirtd" ]; + }; + + # Setup home manager + home-manager = { + extraSpecialArgs = {inherit inputs; }; + backupFileExtension = "backup"; + users = { + crony = import ./home.nix; + }; + }; + + # Disable hibernation, sleep and other friends + systemd.targets = { + sleep = { + enable = false; + unitConfig.DefaultDependencies = "no"; + }; + suspend = { + enable = false; + unitConfig.DefaultDependencies = "no"; + }; + hibernate = { + enable = false; + unitConfig.DefaultDependencies = "no"; + }; + "hybrid-sleep" = { + enable = false; + unitConfig.DefaultDependencies = "no"; + }; + }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile + environment.systemPackages = with pkgs; [ + neovim + mangohud + ]; + + # Getting gaming setup + programs.steam.enable = true; + programs.steam.gamescopeSession.enable = true; + programs.gamemode.enable = true; + + # Enable sytling using stylix + stylix.enable = true; + stylix.autoEnable=true; + stylix.image = ./wallpaper.png; + stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-medium.yaml"; + + # Change Cursor + stylix.cursor.package = pkgs.bibata-cursors; + stylix.cursor.name = "Bibata-Modern-Ice"; + + # Change u those fonts + stylix.fonts = { + serif = { + package = pkgs.dejavu_fonts; + name = "DejaVu Serif"; + }; + + sansSerif = { + package = pkgs.dejavu_fonts; + name = "DejaVu Sans"; + }; + + monospace = { + package = pkgs.nerd-fonts.caskaydia-cove; + name = "CaskaydiaCove Nerd Font"; + }; + + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; + }; + }; + + # Change terminal font size + stylix.fonts.sizes.terminal = 15; + + # Change chrome settings + stylix.targets.chromium.enable = true; + + # Enable zram swap device + zramSwap.enable = true; + + # DO NOT CHANGE + system.stateVersion = "24.11"; # Did you read the comment? +} diff --git a/hosts/default/hardware-configuration.nix b/hosts/default/hardware-configuration.nix new file mode 100644 index 0000000..9317db1 --- /dev/null +++ b/hosts/default/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" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/0fbf752d-9234-42bd-9e04-8246de85e8d6"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/3156-31B6"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + 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..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"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/default/home.nix b/hosts/default/home.nix new file mode 100644 index 0000000..9737b50 --- /dev/null +++ b/hosts/default/home.nix @@ -0,0 +1,79 @@ +{ config, pkgs, ... }: + +{ + # Some info + home.username = "crony"; + home.homeDirectory = "/home/crony"; + + # PACKAGES + home.packages = with pkgs; [ + librewolf + thunderbird + qbittorrent + ]; + + # Enable programs to get their themes + programs.foot.enable = true; + programs.mangohud = { + enable = true; + settings = { + fps_limit = "0,30,60,120,144"; + gpu_stats = true; + gpu_temp = true; + gpu_core_clock = true; + gpu_power = true; + gpu_text = "GPU"; + gpu_load_change = true; + + cpu_stats = true; + cpu_temps = true; + cpu_text = "CPU"; + cpu_mhz = true; + cpu_load_change = true; + + vram = true; + ram = true; + + fps = true; + fps_sampling_period = "1000"; + fps_color_change = true; + gpu_name = true; + vulka_driver = true; + round_corder = "10"; + offset_x = "10"; + offset_y = "10"; + + width = "250"; + }; + }; + + programs.neovim.enable = true; + + # Enable theming chromium + use ungoogled chromium package + programs.chromium = { + enable = true; + package = pkgs.ungoogled-chromium; + }; + + # Enable git + programs.git = { + enable = true; + userName = "Crony Akatsuki"; + userEmail = "crony@cronyakatsuki.xyz"; + }; + + # Default environmental variables + home.sessionVariables = { + EDITOR = "nvim"; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + + # Fix gtkrc-2.0 collision + home.file."/home/crony/.gtkrc-2.0".force = true; + + # DO NOT CHANGE ALSO + home.stateVersion = "24.11"; # Please read the comment before changing. +} + diff --git a/hosts/default/wallpaper.png b/hosts/default/wallpaper.png new file mode 100644 index 0000000..f32c5b5 Binary files /dev/null and b/hosts/default/wallpaper.png differ