Basic ubuntu setup using nix

This commit is contained in:
Cyryl Płotnicki 2019-08-04 20:15:07 +01:00
parent 551114c780
commit f91980ed53
2 changed files with 46 additions and 18 deletions

40
nixos/home-other-os.nix Normal file
View file

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

View file

@ -5,28 +5,16 @@ set -v
sudo apt update sudo apt update
sudo apt -y upgrade 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 flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
# gsconnect curl https://nixos.org/nix/install | sh
sudo ufw allow 1714:1764/udp
sudo ufw allow 1714:1764/tcp
sudo ufw reload
if [[ -z $USER ]]; then . /home/cyryl/.nix-profile/etc/profile.d/nix.sh
USER=`whoami` export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
fi
sudo groupadd docker | true ln -vfs $HOME/dev/dotfiles/nixos/home-other-os.nix $HOME/.config/nixpkgs/home.nix
sudo usermod -aG docker $USER
if [[ -z $NO_SYSTEMCTL ]]; then home-manager switch
sudo systemctl enable --now tlp
sudo systemctl enable --now docker
sudo systemctl enable --now syncthing@$USER.service
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DIR="$DIR/../"
DIR="$DIR" $DIR/common/up.sh