Compare commits

...

12 commits

Author SHA1 Message Date
384fdd9172 hosts: add tablet 2024-05-27 01:32:41 +02:00
1308bb8cc5 hosts/main: remove imports from etc
/etc/nixos/configuration.nix should import hosts configuration instead
2024-05-27 01:32:24 +02:00
8c352ea5ec shell/kitty: add shortcut for copying with ansi 2024-05-26 21:15:26 +02:00
99a10f35dd core: move bootloader to hosts 2024-05-22 15:41:40 +02:00
22a7d47ace core: split to core-desktop.nix 2024-05-22 15:41:40 +02:00
0dfba79fd3 shell: remove unused comment 2024-05-21 20:22:48 +02:00
6d793ecb1c core: move neovim to shell.nix 2024-05-21 20:22:26 +02:00
1786dbfac7 core: move programs.steam to account.nix 2024-05-21 20:07:30 +02:00
6a7dff6a96 core: remove firewall option definition 2024-05-21 16:09:40 +02:00
43ba0271aa core: move system.stateVersion to hosts 2024-05-21 15:15:01 +02:00
ab2c2b00fb core: move desktop apps to account.nix 2024-05-21 15:08:52 +02:00
1095c7884b core: disable flatpak 2024-05-21 15:03:32 +02:00
7 changed files with 121 additions and 100 deletions

View file

@ -2,11 +2,8 @@
{ {
imports = [ 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.nix
../nix-os/core-desktop.nix
../nix-os/nvidia.nix ../nix-os/nvidia.nix
../nix-os/docker.nix ../nix-os/docker.nix
../nix-os/razer.nix ../nix-os/razer.nix
@ -22,4 +19,11 @@
../nix-os/xdg-default-apps.nix ../nix-os/xdg-default-apps.nix
../nix-os/services/nix-binary-cache.nix ../nix-os/services/nix-binary-cache.nix
]; ];
config = {
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
system.stateVersion = "23.05";
};
} }

39
hosts/tablet.nix Normal file
View file

@ -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";
};
}

View file

@ -21,10 +21,18 @@
vivaldi vivaldi
discord-canary discord-canary
unstablePkgs.vscode unstablePkgs.vscode
gimp
inkscape
krita
]; ];
}; };
users.groups.wroclaw.gid = 1000; users.groups.wroclaw.gid = 1000;
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
};
services.syncthing = { services.syncthing = {
enable = true; enable = true;
user = "wroclaw"; user = "wroclaw";

28
nix-os/core-desktop.nix Normal file
View file

@ -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
'';
};
}

View file

@ -5,39 +5,11 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# kernel # kernel
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Enable networking # Enable networking
networking.networkmanager.enable = true; 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 # Allow unfree packages
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
@ -49,59 +21,14 @@
git git
ffmpeg ffmpeg
yt-dlp yt-dlp
mpv
htop htop
btop btop
fastfetch fastfetch
ranger ranger
gimp
inkscape
krita
smartmontools smartmontools
ddrescue 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 # Enable fail2ban because of the OpenSSH server
services.fail2ban = { services.fail2ban = {
enable = true; enable = true;
@ -116,20 +43,5 @@
22 22
8022 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
} }

View file

@ -1,4 +1,4 @@
{ config, pkgs, unstablePkgs, ... }: { config, pkgs, unstablePkgs, lib, ... }:
let let
rangerGit = pkgs.ranger.overrideAttrs (old: { rangerGit = pkgs.ranger.overrideAttrs (old: {
@ -54,6 +54,8 @@ in
${if config.services.xserver.desktopManager.gnome.enable then "hide_window_decorations yes" else ""} ${if config.services.xserver.desktopManager.gnome.enable then "hide_window_decorations yes" else ""}
background_opacity 0.8 background_opacity 0.8
dynamic_background_opacity yes dynamic_background_opacity yes
map kitty_mod+alt+c copy_ansi_to_clipboard
''; '';
environment.etc."ranger/rc.conf".text = '' environment.etc."ranger/rc.conf".text = ''
@ -75,6 +77,41 @@ in
programs.direnv.enable = true; 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 = { programs.starship = {
enable = true; enable = true;
settings = { settings = {
@ -92,12 +129,6 @@ in
command = "echo \"\""; command = "echo \"\"";
style = "bold 208"; style = "bold 208";
}; };
# custom.PS1 = {
# when = true;
# command = "echo -e \"\\x1b\\x5d133;A\\x1b\\x5c\"";
# format = "$output";
# use_stdin = false;
# };
}; };
}; };
} }

View file

@ -1 +0,0 @@
NIXOS_CONFIG="$(pwd)/hosts/main.nix" nixos-rebuild $@