diff --git a/intel-update.sh b/intel-update.sh deleted file mode 100755 index 2d310ad..0000000 --- a/intel-update.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -sudo nix-channel --update && -sudo nixos-rebuild boot -p Intel -I nixos-config=./nixos/intel.nix diff --git a/nixos/intel.nix b/nixos/odin-intel.nix similarity index 94% rename from nixos/intel.nix rename to nixos/odin-intel.nix index e0cb356..73b3b19 100644 --- a/nixos/intel.nix +++ b/nixos/odin-intel.nix @@ -5,7 +5,7 @@ { config, pkgs, ... }: { - imports = builtins.trace "Intel laptop configuration" [ + imports = [ ./base.nix ]; diff --git a/nixos/nvidia.nix b/nixos/odin-nvidia.nix similarity index 100% rename from nixos/nvidia.nix rename to nixos/odin-nvidia.nix diff --git a/nixos/thor.nix b/nixos/thor.nix new file mode 100644 index 0000000..5896cc6 --- /dev/null +++ b/nixos/thor.nix @@ -0,0 +1,33 @@ +# 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, ... }: + +{ + imports = [ + + + ./base.nix + ]; + + hardware.enableRedistributableFirmware = true; + + services.xserver = { + videoDrivers = [ "nvidia" ]; + displayManager.sddm = { + enable = true; + autoNumlock = true; + }; + }; + + hardware.nvidia.prime = { + offload.enable = false; + sync.enable = true; + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + # hardware.nvidia.modesetting.enable = true; + # hardware.nvidia.package = pkgs.linuxPackages.nvidia_x11; + hardware.opengl.driSupport32Bit = true; +} diff --git a/nvidia-update.sh b/nvidia-update.sh deleted file mode 100755 index 8c0e8bb..0000000 --- a/nvidia-update.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -sudo nix-channel --update && -sudo nixos-rebuild boot -p Nvidia -I nixos-config=./nixos/nvidia.nix diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..62b4643 --- /dev/null +++ b/setup.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +sudo nix-channel --add https://nixos.org/channels/nixos-21.05 nixos +sudo nix-channel --add https://github.com/NixOS/nixos-hardware/archive/master.tar.gz nixos-hardware + +nix-channel --add https://nixos.org/channels/nixos-21.05 nixos +nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager +nix-channel --add https://github.com/NixOS/nixpkgs/archive/master.tar.gz nixpkgs diff --git a/thor.nix b/thor.nix new file mode 100644 index 0000000..ca2aab0 --- /dev/null +++ b/thor.nix @@ -0,0 +1,205 @@ +{ pkgs, lib, ... }: +{ + nixpkgs.overlays = [ + (final: prev: { + devEnvironment = (import ./environment.nix) { + enableCpp = true; + enableData = true; + enableGo = true; + enableHtml = true; + enableJavascript = true; + enableJava = true; + enableLatex = true; + enableNix = true; + enableOffice = true; + enablePython = true; + enableRust = true; + enableShell = true; + enableSpelling = true; + }; + + cocktail-bar-cli = final.callPackage ./custom/cocktail-bar-cli { }; + update-background = final.callPackage ./custom/update-background { backgrounds_directory = "$HOME/Immagini/Sfondi/1080+/1440+"; }; + lockscreen = final.callPackage ./custom/lockscreen { + palette = final.rice.colorPalette; + font = final.rice.font.normal; + }; + }) + ]; + + home = { + language.base = "it_IT.UTF-8"; + keyboard = { + layout = "it"; + options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" ]; + }; + packages = with pkgs; [ + pulseaudio + easyeffects + + kubectl + docker-compose + docker-machine + + arandr + authy + blender + btop + catgirl # IRC + cava + discord + # evolution + file + firefox + gallery-dl + gnome.dconf-editor + gnome.eog + gnome.evince + gnomeExtensions.appindicator + gnomeExtensions.caffeine + gnomeExtensions.dash-to-dock + gnomeExtensions.dynamic-panel-transparency + gnomeExtensions.just-perfection + gnome.file-roller + gnome.geary + gnome.ghex + gnome.gitg + gnome.gnome-screenshot + gnome.gnome-sound-recorder + gnome.gnome-sudoku + gnome.gnome-system-monitor + gnome.gnome-tweaks + gnome.nautilus + gnome.quadrapassel + gnome.seahorse + gnome.sushi + gnome.tracker + google-chrome + gucharmap + htop + # hyperspace-cli + inkscape + jetbrains.datagrip + keepassxc + krita + # lutris + mpv + neofetch + nix-prefetch-scripts + openvpn + pavucontrol + pcmanfm + pentablet-driver + procps-ng + ripgrep + rofimoji + skype + slack + spotify + tdesktop + teams + transmission-gtk + virt-manager + wget + # wineFull + wireguard + xclip + xournalpp + zoom-us + zotero + + ( + retroarch.override { + cores = with pkgs.libretro; [ + mgba + pcsx_rearmed + ppsspp + ]; + } + ) + ]; + }; + + imports = [ + ./modules/configurations.nix + ./modules/fonts.nix + + ./modules/alacritty.nix + ./modules/bash.nix + ./modules/bat.nix + ./modules/bottom.nix + ./modules/broot.nix + # ./modules/bspwm.nix + ./modules/dircolors.nix + ./modules/direnv.nix + # ./modules/dunst.nix + # ./modules/fzf.nix + ./modules/git.nix + ./modules/go.nix + ./modules/gpg.nix + ./modules/grobi.nix + ./modules/info.nix + ./modules/java.nix + # ./modules/joystickwake.nix + ./modules/jq.nix + ./modules/kakoune.nix + ./modules/keep.nix + # ./modules/keepassxc.nix + ./modules/keychain.nix + ./modules/latex.nix + ./modules/lf.nix + ./modules/libinput-gestures.nix + ./modules/lorri.nix + ./modules/man.nix + # ./modules/mangohud.nix + ./modules/megasync.nix + ./modules/nix-index.nix + ./modules/noti.nix + ./modules/obs-studio.nix + ./modules/office.nix + ./modules/onedrive.nix + # ./modules/picom.nix + # ./modules/polybar.nix + ./modules/gtk_theme.nix + ./modules/rofi.nix + # ./modules/screen_locker.nix + ./modules/ssh.nix + ./modules/starship.nix + # ./modules/sxhkd.nix + ./modules/syncthing.nix + ./modules/terminator.nix + ./modules/tmux.nix + ./modules/update_background.nix + ./modules/whatsapp.nix + # ./modules/xidlehook.nix + ./modules/zoxide.nix + ./modules/zsh.nix + + # ./modules/pro_audio.nix + # ./modules/security.nix + + ./modules/shell_aliases.nix + ]; + + + services = { + # blueman-applet.enable = true; + # caffeine.enable = true; + # cbatticon.enable = true; + gnome-keyring.enable = true; + # network-manager-applet.enable = true; + # playerctld.enable = true; + # poweralertd.enable = true; + }; + + # xsession = { + # enable = true; + # numlock.enable = true; + # initExtra = '' + # ## Touchpad + # ${pkgs.xorg.xinput}/bin/xinput set-prop 'DELL0824:00 06CB:7E92 Touchpad' 'libinput Natural Scrolling Enabled' 1 + # ${pkgs.xorg.xinput}/bin/xinput set-prop 'DELL0824:00 06CB:7E92 Touchpad' 'libinput Tapping Enabled' 1 + # ''; + # }; + +} diff --git a/user-update.sh b/update.sh similarity index 51% rename from user-update.sh rename to update.sh index 434133c..6f33630 100755 --- a/user-update.sh +++ b/update.sh @@ -1,3 +1,3 @@ #!/bin/sh +sudo nix-channel --update && nix-channel --update -home-manager switch diff --git a/upgrade.sh b/upgrade.sh new file mode 100755 index 0000000..900d83e --- /dev/null +++ b/upgrade.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env sh +HOST=`cat /etc/hostname` +echo "Upgrading $HOST" +case "$HOST" in + odin) + echo "Found odin" + sudo nixos-rebuild boot -p Intel -I nixos-config=./nixos/odin-intel.nix && + sudo nixos-rebuild boot -p Nvidia -I nixos-config=./nixos/odin-nvidia.nix + ;; + thor | freya) + echo "Found $HOST" + sudo nixos-rebuild boot -I "nixos-config=./nixos/$HOST.nix" + ;; + *) + echo "localhost match not found" + exit 1 + ;; +esac && +home-manager switch + +echo DONE