commit 8334a80c36df25883c102a31145ecddfc18be6b4 Author: Sergei Poljanski(backup-hook) Date: Mon Dec 8 23:26:14 2025 +0200 init diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..a4c5ad7 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,185 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running 'nixos-help'). + +{ config, pkgs, lib, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Bootloader. + # boot.loader.systemd-boot.enable = true; #Disabled for GRUB + boot.loader.efi.canTouchEfiVariables = true; + + # Grub + boot.loader.grub.enable = true; + boot.loader.grub.device = "nodev"; + boot.loader.grub.efiSupport = true; + # boot.loader.grub.useOSProber = true; + # boot.loader.grub.extraConfig = "GRUB_DISABLE_OS_PROBER=false"; + boot.loader.grub.extraEntries = '' + menuentry "Arch Linux (zen)" { + search --set=root --fs-uuid 15ae8384-3dfc-4915-9201-66ecfc5f230d + linux /@/boot/vmlinuz-linux-zen root=UUID=15ae8384-3dfc-4915-9201-66ecfc5f230d rootflags=subvol=@ rw + initrd /@/boot/initramfs-linux-zen.img + } + + menuentry "Arch Linux (default)" { + search --set=root --fs-uuid 15ae8384-3dfc-4915-9201-66ecfc5f230d + linux /@/boot/vmlinuz-linux root=UUID=15ae8384-3dfc-4915-9201-66ecfc5f230d rootflags=subvol=@ rw + initrd /@/boot/initramfs-linux.img + } + + menuentry "Arch Linux (lts)" { + search --set=root --fs-uuid 15ae8384-3dfc-4915-9201-66ecfc5f230d + linux /@/boot/vmlinuz-linux-lts root=UUID=15ae8384-3dfc-4915-9201-66ecfc5f230d rootflags=subvol=@ rw + initrd /@/boot/initramfs-linux-lts.img + } + ''; + + networking.hostName = "nixos"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "Europe/Tallinn"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_IN"; + LC_IDENTIFICATION = "en_IN"; + LC_MEASUREMENT = "en_IN"; + LC_MONETARY = "en_IN"; + LC_NAME = "en_IN"; + LC_NUMERIC = "en_IN"; + LC_PAPER = "en_IN"; + LC_TELEPHONE = "en_IN"; + LC_TIME = "en_IN"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the GNOME Desktop Environment. + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # 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; + # 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; + + # Define a user account. Don't forget to set a password with 'passwd'. + users.users.asxpi = { + isNormalUser = true; + description = "Sergei P"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; [ + # Internet + thunderbird + telegram-desktop + firefox-devedition-bin + # claude-code is now provided by the flake + zed-editor + ]; + }; + + # Install firefox. + # programs.firefox.enable = true; + + # 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. + # wget + os-prober + nano + git + btrfs-progs + curl + wget + htop + fastfetch + nodejs_20 + ]; + + # Create a wrapper script for nixos-rebuild + environment.shellAliases = { + nrs = "sudo nixos-rebuild switch && cd /etc/nixos && sudo git add -A && sudo git commit -m 'Update: $(date +%Y-%m-%d_%H:%M)' && sudo git push origin main"; + }; + + environment.etc."gitconfig".text = '' + [user] + name = Sergei Poljanski + email = me@asxp.io + [init] + defaultBranch = main + [safe] + directory = /etc/nixos + ''; + + # Enable flakes + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # 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 = "25.11"; # Did you read the comment? + +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..34d97cf --- /dev/null +++ b/flake.lock @@ -0,0 +1,82 @@ +{ + "nodes": { + "claude-code-nix": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1765105289, + "narHash": "sha256-OwPB2MW4V+CD8QpqaV5GnWdKuhVZ9LoSqJxYcWTmSx0=", + "owner": "sadjow", + "repo": "claude-code-nix", + "rev": "d1fa648842116e632e008e55cb7ec213fdc37ba1", + "type": "github" + }, + "original": { + "owner": "sadjow", + "repo": "claude-code-nix", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "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" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1764950072, + "narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f61125a668a320878494449750330ca58b78c557", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "claude-code-nix": "claude-code-nix", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..22f27dd --- /dev/null +++ b/flake.nix @@ -0,0 +1,26 @@ +{ + description = "NixOS configuration with latest Claude Code"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + claude-code-nix = { + url = "github:sadjow/claude-code-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, claude-code-nix, ... }@inputs: { + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./configuration.nix + ({ pkgs, inputs, ... }: { + environment.systemPackages = [ + inputs.claude-code-nix.packages.${pkgs.system}.default + ]; + }) + ]; + }; + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..5830e80 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,33 @@ +# 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" "usb_storage" "usbhid" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/mapper/luks-71c97ce7-dd29-4b07-8d2a-8cc3985a65bd"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-71c97ce7-dd29-4b07-8d2a-8cc3985a65bd".device = "/dev/disk/by-uuid/71c97ce7-dd29-4b07-8d2a-8cc3985a65bd"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/8895-7EE4"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}