From 7dc43ff3c85fba195ee34b612d081aae21f4d75b Mon Sep 17 00:00:00 2001 From: illustris Date: Wed, 7 Apr 2021 22:15:50 +0530 Subject: [PATCH] Changes - use niv, for real this time - support ARM builds - install ADB, rofi, nmap, fping - reduplicate and remove limit on bash history - change prompt color and remove extra newline - replace chromium with ungoogled-chromium - install obs-studio, zoom-us - Add desktop notifications with dunst, libnotify - bump nixpkgs --- configuration.nix | 44 ++++++++++++++++++++++++++++++++++++--- desktop-configuration.nix | 25 +++++++++++++++++++++- nix/sources.json | 6 +++--- 3 files changed, 68 insertions(+), 7 deletions(-) diff --git a/configuration.nix b/configuration.nix index 6d346f4..a937d94 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,7 +1,6 @@ { config, - sources ? import ./nix/sources.nix, - pkgs ? import sources.nixpkgs {}, + pkgs, ... }: @@ -10,11 +9,23 @@ nixpkgs.overlays = [ ]; + # Use nixpkgs from niv + nixpkgs.pkgs = let + sources = import ./nix/sources.nix; + in import sources.nixpkgs { + config = config.nixpkgs.config // { + allowUnfree = true; + }; + }; + imports = [ ./hardware-configuration.nix ./desktop-configuration.nix ]; + # Support ARM builds + boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; + boot.kernelPackages = pkgs.linuxPackages_latest; boot.loader.systemd-boot.enable = true; @@ -38,12 +49,14 @@ users.users = { illustris = { isNormalUser = true; - extraGroups = [ "wheel" "docker" "tty" ]; # Enable ‘sudo’ for the user. + extraGroups = [ "wheel" "docker" "tty" "adb" ]; openssh.authorizedKeys.keyFiles = [ ./secrets/ssh_pubkeys ]; }; root.openssh.authorizedKeys.keyFiles = [ ./secrets/ssh_pubkeys ]; }; + programs.adb.enable = true; + environment.systemPackages = with pkgs; [ git tmux @@ -77,12 +90,37 @@ nixpkgs-review (pkgs.callPackage /home/illustris/src/percol/percol {}) niv + ( + rofi.override { plugins = [ + rofi-calc + rofi-pass + rofi-systemd + ]; } + ) + nmap + fping ]; programs.gnupg.agent = { enable = true; }; + programs.bash = { + interactiveShellInit = '' + export HISTSIZE=-1 HISTFILESIZE=-1 HISTCONTROL=ignoreboth:erasedups; + ''; + shellAliases = { + genpass = "cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 2"; + }; + promptInit = '' + if [ "$TERM" != "dumb" -o -n "$INSIDE_EMACS" ]; then + PROMPT_COLOR="1;31m" + let $UID && PROMPT_COLOR="1;36m" + PS1="\[\033[$PROMPT_COLOR\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\\$\[\033[0m\] " + fi + ''; + }; + services = { openssh = { enable = true; diff --git a/desktop-configuration.nix b/desktop-configuration.nix index 407725e..82e50f3 100644 --- a/desktop-configuration.nix +++ b/desktop-configuration.nix @@ -31,8 +31,26 @@ nixpkgs.config.allowUnfree = true; programs.steam.enable = true; + programs.chromium = { + enable = true; + extraOpts = { + "PasswordManagerEnabled" = false; + "ClearSiteDataOnExit" = false; + }; + extensions = [ + "gcbommkclmclpchllfjekcdonpmejbdp" # https everywhere + "cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock origin + "iipjdmnoigaobkamfhnojmglcdbnfaaf" # Clutter Free + "bdakmnplckeopfghnlpocafcepegjeap" # RescueTime + "gppongmhjkpfnbhagpmjfkannfbllamg" # wappalyzer + "lcbjdhceifofjlpecfpeimnnphbcjgnc" # xBrowserSync + "chlffgpmiacpedhhbkiomidkjlcfhogd" # pushbullet + ]; + homepageLocation = "https://duckduckgo.com/"; + defaultSearchProviderSuggestURL = "https://duckduckgo.com/?q={searchTerms}&kp=-1&kac=1"; + defaultSearchProviderSearchURL = "https://duckduckgo.com/?q=search&kp=-1"; + }; environment.systemPackages = with pkgs; [ - chromium st dmenu mpv @@ -57,6 +75,11 @@ blender wireshark flutter + obs-studio + dunst + libnotify + ungoogled-chromium + zoom-us ]; hardware.pulseaudio = { diff --git a/nix/sources.json b/nix/sources.json index b5e9a7c..e13cb1e 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -17,10 +17,10 @@ "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f5e8bdd07d1afaabf6b37afc5497b1e498b8046f", - "sha256": "1fmwkb2wjfrpx8fis4x457vslam0x8vqlpfwqii6p9vm33dyxhzk", + "rev": "ad47284f8b01f587e24a4f14e0f93126d8ebecda", + "sha256": "00m8zhb9lf1shkaf572imsmxq20fmq397jcydx3c651fi28i6rgs", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/f5e8bdd07d1afaabf6b37afc5497b1e498b8046f.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/ad47284f8b01f587e24a4f14e0f93126d8ebecda.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } }