From 1095c7884b8ebd5ef209f2326d5e189dd55ed4cb Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Tue, 21 May 2024 15:03:32 +0200 Subject: [PATCH 01/12] core: disable flatpak --- nix-os/core.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/nix-os/core.nix b/nix-os/core.nix index f58b699..b02c4d4 100644 --- a/nix-os/core.nix +++ b/nix-os/core.nix @@ -22,9 +22,6 @@ # 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; From ab2c2b00fb540dc4230af5ada00913423c71376e Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Tue, 21 May 2024 15:08:52 +0200 Subject: [PATCH 02/12] core: move desktop apps to account.nix --- nix-os/account.nix | 3 +++ nix-os/core.nix | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nix-os/account.nix b/nix-os/account.nix index d6f763e..5f4cc61 100644 --- a/nix-os/account.nix +++ b/nix-os/account.nix @@ -21,6 +21,9 @@ vivaldi discord-canary unstablePkgs.vscode + gimp + inkscape + krita ]; }; users.groups.wroclaw.gid = 1000; diff --git a/nix-os/core.nix b/nix-os/core.nix index b02c4d4..4208c2c 100644 --- a/nix-os/core.nix +++ b/nix-os/core.nix @@ -51,9 +51,6 @@ btop fastfetch ranger - gimp - inkscape - krita smartmontools ddrescue ]; From 43ba0271aa8e16a8587e44fc63c7b59f78df71fd Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Tue, 21 May 2024 15:15:01 +0200 Subject: [PATCH 03/12] core: move system.stateVersion to hosts --- hosts/main.nix | 4 ++++ nix-os/core.nix | 9 --------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/hosts/main.nix b/hosts/main.nix index 49a9b8f..81c2d7a 100644 --- a/hosts/main.nix +++ b/hosts/main.nix @@ -22,4 +22,8 @@ ../nix-os/xdg-default-apps.nix ../nix-os/services/nix-binary-cache.nix ]; + + config = { + system.stateVersion = "23.05"; + }; } \ No newline at end of file diff --git a/nix-os/core.nix b/nix-os/core.nix index 4208c2c..b024239 100644 --- a/nix-os/core.nix +++ b/nix-os/core.nix @@ -117,13 +117,4 @@ # 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 } From 6a7dff6a96a2fe618120b0331f6573be1331de63 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Tue, 21 May 2024 16:09:40 +0200 Subject: [PATCH 04/12] core: remove firewall option definition --- nix-os/core.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/nix-os/core.nix b/nix-os/core.nix index b024239..34a0801 100644 --- a/nix-os/core.nix +++ b/nix-os/core.nix @@ -114,7 +114,4 @@ X11Forwarding yes ''; }; - - # Disable firewall - networking.firewall.enable = false; } From 1786dbfac7feb5d339578cec8b85137e2c26786f Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Tue, 21 May 2024 20:07:30 +0200 Subject: [PATCH 05/12] core: move programs.steam to account.nix --- nix-os/account.nix | 5 +++++ nix-os/core.nix | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nix-os/account.nix b/nix-os/account.nix index 5f4cc61..2b603c6 100644 --- a/nix-os/account.nix +++ b/nix-os/account.nix @@ -28,6 +28,11 @@ }; users.groups.wroclaw.gid = 1000; + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + }; + services.syncthing = { enable = true; user = "wroclaw"; diff --git a/nix-os/core.nix b/nix-os/core.nix index 34a0801..ffc5a40 100644 --- a/nix-os/core.nix +++ b/nix-os/core.nix @@ -91,11 +91,6 @@ VISUAL = EDITOR; }; - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - }; - # Enable fail2ban because of the OpenSSH server services.fail2ban = { enable = true; From 6d793ecb1ce9e465df855e65e5ee3874078d2425 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Tue, 21 May 2024 20:22:26 +0200 Subject: [PATCH 06/12] core: move neovim to shell.nix --- nix-os/core.nix | 36 ------------------------------------ nix-os/shell.nix | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/nix-os/core.nix b/nix-os/core.nix index ffc5a40..663354f 100644 --- a/nix-os/core.nix +++ b/nix-os/core.nix @@ -55,42 +55,6 @@ 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; - }; - # Enable fail2ban because of the OpenSSH server services.fail2ban = { enable = true; diff --git a/nix-os/shell.nix b/nix-os/shell.nix index 99408c2..d742dc7 100644 --- a/nix-os/shell.nix +++ b/nix-os/shell.nix @@ -1,4 +1,4 @@ -{ config, pkgs, unstablePkgs, ... }: +{ config, pkgs, unstablePkgs, lib, ... }: let rangerGit = pkgs.ranger.overrideAttrs (old: { @@ -75,6 +75,41 @@ 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 = { From 0dfba79fd33455c2a6cb213c7d000b3617d9ed21 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Tue, 21 May 2024 20:22:48 +0200 Subject: [PATCH 07/12] shell: remove unused comment --- nix-os/shell.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/nix-os/shell.nix b/nix-os/shell.nix index d742dc7..3308eab 100644 --- a/nix-os/shell.nix +++ b/nix-os/shell.nix @@ -127,12 +127,6 @@ in command = "echo \"✦\""; style = "bold 208"; }; - # custom.PS1 = { - # when = true; - # command = "echo -e \"\\x1b\\x5d133;A\\x1b\\x5c\""; - # format = "$output"; - # use_stdin = false; - # }; }; }; } From 22a7d47aced9963388cfa2799ebb98f6190b30cc Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Wed, 22 May 2024 15:32:40 +0200 Subject: [PATCH 08/12] core: split to core-desktop.nix --- hosts/main.nix | 1 + nix-os/core-desktop.nix | 28 ++++++++++++++++++++++++++++ nix-os/core.nix | 25 ------------------------- 3 files changed, 29 insertions(+), 25 deletions(-) create mode 100644 nix-os/core-desktop.nix diff --git a/hosts/main.nix b/hosts/main.nix index 81c2d7a..faa817e 100644 --- a/hosts/main.nix +++ b/hosts/main.nix @@ -7,6 +7,7 @@ # 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 diff --git a/nix-os/core-desktop.nix b/nix-os/core-desktop.nix new file mode 100644 index 0000000..2f5a087 --- /dev/null +++ b/nix-os/core-desktop.nix @@ -0,0 +1,28 @@ +{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 663354f..994a483 100644 --- a/nix-os/core.nix +++ b/nix-os/core.nix @@ -12,29 +12,8 @@ # 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 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; @@ -46,7 +25,6 @@ git ffmpeg yt-dlp - mpv htop btop fastfetch @@ -69,8 +47,5 @@ 22 8022 ]; - extraConfig = '' - X11Forwarding yes - ''; }; } From 99a10f35ddcbe1d427ebb9c8f6ffc888f4931bf9 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Wed, 22 May 2024 15:33:26 +0200 Subject: [PATCH 09/12] core: move bootloader to hosts --- hosts/main.nix | 3 +++ nix-os/core.nix | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hosts/main.nix b/hosts/main.nix index faa817e..c9f3d25 100644 --- a/hosts/main.nix +++ b/hosts/main.nix @@ -25,6 +25,9 @@ ]; 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/nix-os/core.nix b/nix-os/core.nix index 994a483..d79f6e9 100644 --- a/nix-os/core.nix +++ b/nix-os/core.nix @@ -5,10 +5,6 @@ { config, pkgs, lib, ... }: { - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - # kernel boot.kernelPackages = pkgs.linuxPackages_latest; From 8c352ea5ecd2cd46d1d7c17b1e72780897a08ffa Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Sun, 26 May 2024 21:15:26 +0200 Subject: [PATCH 10/12] shell/kitty: add shortcut for copying with ansi --- nix-os/shell.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nix-os/shell.nix b/nix-os/shell.nix index 3308eab..c13ffbe 100644 --- a/nix-os/shell.nix +++ b/nix-os/shell.nix @@ -54,6 +54,8 @@ 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 = '' From 1308bb8cc5f8bbc2f3ed734bafb9477dcb56a8d6 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Mon, 27 May 2024 01:32:24 +0200 Subject: [PATCH 11/12] hosts/main: remove imports from etc /etc/nixos/configuration.nix should import hosts configuration instead --- hosts/main.nix | 4 ---- nixos-rebuild.sh | 1 - 2 files changed, 5 deletions(-) delete mode 100755 nixos-rebuild.sh diff --git a/hosts/main.nix b/hosts/main.nix index c9f3d25..7b7cbdf 100644 --- a/hosts/main.nix +++ b/hosts/main.nix @@ -2,10 +2,6 @@ { 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 diff --git a/nixos-rebuild.sh b/nixos-rebuild.sh deleted file mode 100755 index 55aa311..0000000 --- a/nixos-rebuild.sh +++ /dev/null @@ -1 +0,0 @@ -NIXOS_CONFIG="$(pwd)/hosts/main.nix" nixos-rebuild $@ From 384fdd9172a74700d110e1298dc105f4d472487c Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Mon, 27 May 2024 01:32:41 +0200 Subject: [PATCH 12/12] hosts: add tablet --- hosts/tablet.nix | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 hosts/tablet.nix diff --git a/hosts/tablet.nix b/hosts/tablet.nix new file mode 100644 index 0000000..b369d47 --- /dev/null +++ b/hosts/tablet.nix @@ -0,0 +1,39 @@ +{ 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"; + }; +} +