add initial config
This commit is contained in:
commit
36e92d95c2
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/hardware-configuration.nix
|
8
README.md
Normal file
8
README.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
# FelschR's NixOS configuration
|
||||
|
||||
## Installation on new machine
|
||||
To setup a new machine run the following command after completing partitioning and mounting:
|
||||
```
|
||||
./install.sh <NIX_CONFIG>
|
||||
```
|
||||
This runs `nixos-generate-config`, symlinks the passed configuration to `/etc/nixos/configuration.nix`, sets up required nix channels and then runs `nixos-install`.
|
1
configuration.nix
Symbolic link
1
configuration.nix
Symbolic link
|
@ -0,0 +1 @@
|
|||
home-pc.nix
|
121
home-pc.nix
Normal file
121
home-pc.nix
Normal file
|
@ -0,0 +1,121 @@
|
|||
# Import unstable and home-manager channels:
|
||||
# sudo nix-channel --add http://nixos.org/channels/nixos-unstable nixos-unstable
|
||||
# sudo nix-channel --add https://github.com/rycee/home-manager/archive/release-19.03.tar.gz home-manager
|
||||
# sudo nix-channel --update
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
unstable = import <nixos-unstable> {};
|
||||
in
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
<home-manager/nixos>
|
||||
];
|
||||
|
||||
# configure unfree and unstable packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
libu2f-host = unstable.libu2f-host;
|
||||
})
|
||||
];
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.initrd.luks.devices = [
|
||||
{
|
||||
name = "root";
|
||||
device = "/dev/disk/by-uuid/a08f2cb3-2a6d-4dbc-b846-4a42ca137117";
|
||||
preLVM = true;
|
||||
allowDiscards = true;
|
||||
}
|
||||
];
|
||||
# boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = false;
|
||||
|
||||
networking.hostName = "felix-nixos"; # Define your hostname.
|
||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n = {
|
||||
consoleFont = "Lat2-Terminus16";
|
||||
consoleKeyMap = "uk";
|
||||
defaultLocale = "en_GB.UTF-8";
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
wget
|
||||
curl
|
||||
networkmanager
|
||||
neovim
|
||||
gnomeExtensions.dash-to-panel
|
||||
gnomeExtensions.topicons-plus
|
||||
unstable.libu2f-host
|
||||
];
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
services.printing.enable = true;
|
||||
|
||||
# Enable sound.
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = true;
|
||||
hardware.pulseaudio.support32Bit = true;
|
||||
|
||||
# NVIDIA drivers
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
|
||||
# Enable special device support
|
||||
hardware.ledger.enable = true;
|
||||
hardware.u2f.enable = true;
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = true;
|
||||
services.xserver.layout = "gb";
|
||||
services.xserver.xkbOptions = "eurosign:e";
|
||||
|
||||
# Enable Gnome 3
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
services.xserver.displayManager.gdm.wayland = false;
|
||||
services.xserver.desktopManager.gnome3.enable = true;
|
||||
services.dbus.packages = with pkgs; [
|
||||
gnome3.dconf gnome2.GConf
|
||||
];
|
||||
environment.gnome3.excludePackages = with pkgs; [
|
||||
gnome3.gnome-weather
|
||||
gnome3.gnome-calendar
|
||||
gnome3.gnome-todo
|
||||
# gnome3.gnome-books
|
||||
gnome3.gnome-maps
|
||||
gnome3.gnome-contacts
|
||||
gnome3.gnome-software
|
||||
gnome3.gnome-packagekit
|
||||
gnome3.epiphany
|
||||
gnome3.evolution
|
||||
gnome3.accerciser
|
||||
];
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.users.felschr = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "audio" ]; # Enable ‘sudo’ for the user.
|
||||
shell = pkgs.fish;
|
||||
};
|
||||
home-manager.users.felschr = import ./home/felschr.nix;
|
||||
|
||||
# This value determines the NixOS release with which your system is to be
|
||||
# compatible, in order to avoid breaking some software such as database
|
||||
# servers. You should change this only after NixOS release notes say you
|
||||
# should.
|
||||
system.stateVersion = "19.03"; # Did you read the comment?
|
||||
|
||||
}
|
63
home/felschr.nix
Normal file
63
home/felschr.nix
Normal file
|
@ -0,0 +1,63 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# xsession.enable = true;
|
||||
|
||||
gtk.enable = true;
|
||||
gtk.theme.name = "Adwaita-dark";
|
||||
gtk.gtk3.extraConfig = {
|
||||
gtk-application-prefer-dark-theme = true;
|
||||
};
|
||||
|
||||
services.redshift = {
|
||||
enable = true;
|
||||
latitude = "53.2603609";
|
||||
longitude = "10.4014691";
|
||||
};
|
||||
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
};
|
||||
|
||||
programs.termite = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Felix Tenley";
|
||||
userEmail = "dev@felschr.com";
|
||||
};
|
||||
|
||||
programs.emacs = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
# userSettings = {}
|
||||
};
|
||||
|
||||
services.keybase.enable = true;
|
||||
services.kbfs.enable = true;
|
||||
|
||||
programs.chromium = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
signal-desktop
|
||||
discord
|
||||
keybase-gui
|
||||
linux-steam-integration
|
||||
# lutris
|
||||
];
|
||||
}
|
24
install.sh
Executable file
24
install.sh
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $EUID != 0 ]; then
|
||||
sudo "$0" "$@"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
CONFIG=$0
|
||||
|
||||
if [ -z "$CONFIG" ]
|
||||
then
|
||||
echo "path to config to use as configuration.nix needs to be passed as first argument"
|
||||
fi
|
||||
|
||||
ln -s $CONFIG configuration.nix
|
||||
|
||||
nixos-generate-config --root /mnt
|
||||
|
||||
# add nixos-unstable and home-manager channels
|
||||
nix-channel --add http://nixos.org/channels/nixos-unstable nixos-unstable
|
||||
nix-channel --add https://github.com/rycee/home-manager/archive/release-19.03.tar.gz home-manager
|
||||
nix-channel --update
|
||||
|
||||
nixos-install
|
Loading…
Reference in a new issue