From f91980ed537fcc5dfd365efad8fa3c0582ae14be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sun, 4 Aug 2019 20:15:07 +0100 Subject: [PATCH] Basic ubuntu setup using nix --- nixos/home-other-os.nix | 40 ++++++++++++++++++++++++++++++++++++++++ ubuntu/up.sh | 24 ++++++------------------ 2 files changed, 46 insertions(+), 18 deletions(-) create mode 100644 nixos/home-other-os.nix diff --git a/nixos/home-other-os.nix b/nixos/home-other-os.nix new file mode 100644 index 00000000..f258c987 --- /dev/null +++ b/nixos/home-other-os.nix @@ -0,0 +1,40 @@ +{ config, pkgs, ... }: + +let + unstableTarball = fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz; + dotfiles = "/home/cyryl/dev/dotfiles"; +in + { + nixpkgs.config = { + allowUnfree = true; + packageOverrides = pkgs: { + unstable = import unstableTarball { + config = config.nixpkgs.config; + }; + }; + }; + home.packages = with pkgs; [ + fontconfig kpcli + ]; + home.sessionVariables = { + TERMINAL="alacritty"; + }; + + imports = [ + ./programs/tmux.nix + ./programs/zsh.nix + ./programs/vim.nix + ./programs/alacritty.nix + ./programs/git.nix + ]; + + programs = { + home-manager.enable = true; + + fzf.enable = true; + firefox.enable = true; + chromium.enable = true; + go.enable = true; + bat.enable = true; + }; + } diff --git a/ubuntu/up.sh b/ubuntu/up.sh index 57dbdb53..9413564d 100755 --- a/ubuntu/up.sh +++ b/ubuntu/up.sh @@ -5,28 +5,16 @@ set -v sudo apt update sudo apt -y upgrade -sudo apt -y --fix-missing install apt-file aptitude aria2 atop cmake curl git glances gnupg2 keepass2 mercurial pv python-dev python-pip python3-pip ruby-dev tmux vim whois zsh dirmngr syncthing net-tools coreutils xclip wget scdaemon flatpak gnome-software-plugin-flatpak ufw tlp +sudo apt -y --fix-missing install apt-file aptitude git curl flatpak flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo -# gsconnect -sudo ufw allow 1714:1764/udp -sudo ufw allow 1714:1764/tcp -sudo ufw reload +curl https://nixos.org/nix/install | sh -if [[ -z $USER ]]; then - USER=`whoami` -fi +. /home/cyryl/.nix-profile/etc/profile.d/nix.sh +export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH -sudo groupadd docker | true -sudo usermod -aG docker $USER +ln -vfs $HOME/dev/dotfiles/nixos/home-other-os.nix $HOME/.config/nixpkgs/home.nix -if [[ -z $NO_SYSTEMCTL ]]; then - sudo systemctl enable --now tlp - sudo systemctl enable --now docker - sudo systemctl enable --now syncthing@$USER.service -fi +home-manager switch -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -DIR="$DIR/../" -DIR="$DIR" $DIR/common/up.sh