diff --git a/hosts/main.nix b/hosts/main.nix index 7b7cbdf..49a9b8f 100644 --- a/hosts/main.nix +++ b/hosts/main.nix @@ -2,8 +2,11 @@ { imports = [ + # Include the results of the hardware scan. + (if builtins.pathExists /etc/nixos/hardware-configuration.nix then /etc/nixos/hardware-configuration.nix else null) + # Include device-specific overrides + (if builtins.pathExists /etc/nixos/device-configuration.nix then /etc/nixos/device-configuration.nix else null) ../nix-os/core.nix - ../nix-os/core-desktop.nix ../nix-os/nvidia.nix ../nix-os/docker.nix ../nix-os/razer.nix @@ -19,11 +22,4 @@ ../nix-os/xdg-default-apps.nix ../nix-os/services/nix-binary-cache.nix ]; - - config = { - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - system.stateVersion = "23.05"; - }; } \ No newline at end of file diff --git a/hosts/tablet.nix b/hosts/tablet.nix deleted file mode 100644 index b369d47..0000000 --- a/hosts/tablet.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - imports = [ - ../nix-os/core.nix - ../nix-os/core-desktop.nix - ../nix-os/account.nix - ../nix-os/adb.nix - ../nix-os/locale.nix - ../nix-os/shell.nix - - ../nix-os/desktopManagers/gnome.nix - ../nix-os/displayManagers/gdm.nix - ]; - - config = { - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - networking.hostName = "wroclaw-hp"; - networking.networkmanager.enable = true; - networking.firewall.enable = true; - services.xserver.displayManager.gdm.wayland = lib.mkForce true; - hardware.sensor.iio.enable = true; - - networking.firewall.allowedTCPPortRanges = [ - # KDE Connect - rec { from = 1714; to = from + 50; } - ]; - - networking.firewall.allowedUDPPortRanges = [ - # KDE Connect - rec { from = 1714; to = from + 50; } - ]; - - system.stateVersion = "23.11"; - }; -} - diff --git a/nix-os/account.nix b/nix-os/account.nix index 2b603c6..d6f763e 100644 --- a/nix-os/account.nix +++ b/nix-os/account.nix @@ -21,18 +21,10 @@ vivaldi discord-canary unstablePkgs.vscode - gimp - inkscape - krita ]; }; users.groups.wroclaw.gid = 1000; - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - }; - services.syncthing = { enable = true; user = "wroclaw"; diff --git a/nix-os/core-desktop.nix b/nix-os/core-desktop.nix deleted file mode 100644 index 2f5a087..0000000 --- a/nix-os/core-desktop.nix +++ /dev/null @@ -1,28 +0,0 @@ -{config, lib, pkgs, ... }: - -{ - config = { - 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; - - # Enable audio interfaces renaming - wireplumber.enable = true; - }; - - environment.systemPackages = with pkgs; [ - mpv - ]; - - services.openssh.extraConfig = '' - X11Forwarding yes - ''; - }; -} \ No newline at end of file diff --git a/nix-os/core.nix b/nix-os/core.nix index d79f6e9..f58b699 100644 --- a/nix-os/core.nix +++ b/nix-os/core.nix @@ -5,11 +5,39 @@ { config, pkgs, lib, ... }: { + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + # kernel boot.kernelPackages = pkgs.linuxPackages_latest; + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + # Enable networking networking.networkmanager.enable = true; + + # X11 and desktop/display manager is enabled using imported files + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable flatpak, some software is newer here unfortunately + services.flatpak.enable = true; + + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + + # Enable audio interfaces renaming + wireplumber.enable = true; + }; # Allow unfree packages nixpkgs.config.allowUnfree = true; @@ -21,14 +49,59 @@ git ffmpeg yt-dlp + mpv htop btop fastfetch ranger + gimp + inkscape + krita smartmontools ddrescue ]; + # terminal text editor + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + configure = { + customRC = '' + set number + set hlsearch + set incsearch + set tabstop=4 + set softtabstop=4 + set shiftwidth=4 + set expandtab + set autoindent + + syntax on + set encoding=utf-8 + set wildmode=longest,list,full + set listchars=space:·,tab:┄┄» + set indentkeys-=0# + ''; + packages.myVimPackage = with pkgs.vimPlugins; { + start = [ + guess-indent-nvim + vim-visual-multi + ]; + }; + }; + }; + + environment.variables = lib.mkIf config.programs.neovim.enable rec { + EDITOR = "/run/current-system/sw/bin/nvim"; + VISUAL = EDITOR; + }; + + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + }; + # Enable fail2ban because of the OpenSSH server services.fail2ban = { enable = true; @@ -43,5 +116,20 @@ 22 8022 ]; + extraConfig = '' + X11Forwarding yes + ''; }; + + # Disable firewall + 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 = "23.05"; # Did you read the comment? + # I am lazy } diff --git a/nix-os/shell.nix b/nix-os/shell.nix index c13ffbe..99408c2 100644 --- a/nix-os/shell.nix +++ b/nix-os/shell.nix @@ -1,4 +1,4 @@ -{ config, pkgs, unstablePkgs, lib, ... }: +{ config, pkgs, unstablePkgs, ... }: let rangerGit = pkgs.ranger.overrideAttrs (old: { @@ -54,8 +54,6 @@ in ${if config.services.xserver.desktopManager.gnome.enable then "hide_window_decorations yes" else ""} background_opacity 0.8 dynamic_background_opacity yes - - map kitty_mod+alt+c copy_ansi_to_clipboard ''; environment.etc."ranger/rc.conf".text = '' @@ -77,41 +75,6 @@ in programs.direnv.enable = true; - programs.neovim = { - enable = true; - viAlias = true; - vimAlias = true; - configure = { - customRC = '' - set number - set hlsearch - set incsearch - set tabstop=4 - set softtabstop=4 - set shiftwidth=4 - set expandtab - set autoindent - - syntax on - set encoding=utf-8 - set wildmode=longest,list,full - set listchars=space:·,tab:┄┄» - set indentkeys-=0# - ''; - packages.myVimPackage = with pkgs.vimPlugins; { - start = [ - guess-indent-nvim - vim-visual-multi - ]; - }; - }; - }; - - environment.variables = lib.mkIf config.programs.neovim.enable rec { - EDITOR = "/run/current-system/sw/bin/nvim"; - VISUAL = EDITOR; - }; - programs.starship = { enable = true; settings = { @@ -129,6 +92,12 @@ in command = "echo \"✦\""; style = "bold 208"; }; + # custom.PS1 = { + # when = true; + # command = "echo -e \"\\x1b\\x5d133;A\\x1b\\x5c\""; + # format = "$output"; + # use_stdin = false; + # }; }; }; } diff --git a/nixos-rebuild.sh b/nixos-rebuild.sh new file mode 100755 index 0000000..55aa311 --- /dev/null +++ b/nixos-rebuild.sh @@ -0,0 +1 @@ +NIXOS_CONFIG="$(pwd)/hosts/main.nix" nixos-rebuild $@