rename nix to home, add system

This commit is contained in:
Dmitriy Pleshevskiy 2022-08-27 15:02:09 +03:00
parent 4a965d655d
commit a87c4a786c
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
34 changed files with 396 additions and 11 deletions

13
.gitignore vendored
View file

@ -1,21 +1,16 @@
/* /*
!/.gitignore !/.gitignore
!/*.example.nix
!/notes !/notes
!/nix
/nix/*
!/nix/wm
!/nix/shell
!/nix/progs
!/nix/home.nix
!/nix/*.example.nix
!/programs !/programs
!/scripts !/scripts
!/system
!/home
!/wallpapers !/wallpapers
/wallpapers/* /wallpapers/*
!/wallpapers/*.png !/wallpapers/*.png

View file

@ -6,7 +6,7 @@ in
{ {
imports = (import ./wm) ++ (import ./shell) ++ (import ./progs); imports = (import ./wm) ++ (import ./shell) ++ (import ./progs);
targets.genericLinux.enable = true; # targets.genericLinux.enable = true;
# Home Manager needs a bit of information about you and the # Home Manager needs a bit of information about you and the
# paths it should manage. # paths it should manage.
@ -25,6 +25,7 @@ in
asciinema # record the terminal asciinema # record the terminal
neofetch # command-line system information neofetch # command-line system information
alacritty
# tools # tools
xh # friendly and fast tool for sending HTTP requests xh # friendly and fast tool for sending HTTP requests

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
enabled=$(amixer -D pulse sget Master | egrep -o "\[on\]" | wc -l) enabled=$(amixer -D pulse sget Master | egrep -o "\[on\]" | wc -l)
if [[ $enabled == "0" ]]; then if [[ $enabled == "0" ]]; then
echo "off" echo "off"

138
system/configuration.nix Normal file
View file

@ -0,0 +1,138 @@
# 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 =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
boot = {
# Use the GRUB 2 boot loader.
loader.grub = {
enable = true;
version = 2;
device = "/dev/sda";
};
kernelPackages = pkgs.linuxPackages_latest;
};
networking = {
hostName = "nixos"; # Define your hostname.
networkmanager.enable = true;
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
useDHCP = false;
};
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# Set your time zone.
time.timeZone = "Europe/Moscow";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkbOptions in tty.
# };
# Enable the X11 windowing system.
services = {
dbus = {
enable = true;
packages = [ pkgs.dconf ];
};
xserver = {
enable = true;
xkbModel = "pc105";
layout = "us,us";
xkbVariant = "dvorak,";
xkbOptions = "grp:win_space_toggle";
displayManager = {
defaultSession = "none+xmonad";
};
windowManager.xmonad.enable = true;
};
};
# Configure keymap in X11
# services.xserver.xkbOptions = {
# "eurosign:e";
# "caps:escape" # map caps to escape.
# };
# Enable CUPS to print documents.
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
programs.zsh.enable = true;
users.users.root.initialHashedPassword = "";
# Define a user account. Don't forget to set a password with passwd.
users.users.janabhumi = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
shell = pkgs.zsh;
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
alacritty
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
}

View file

@ -0,0 +1,251 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/969c5f68-631d-4429-b81b-0d81e050449b";
fsType = "ext4";
};
#fileSystems."/snap/bare/5" =
# { device = "/var/lib/snapd/snaps/bare_5.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/code/105" =
# { device = "/var/lib/snapd/snaps/code_105.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/core22/188" =
# { device = "/var/lib/snapd/snaps/core22_188.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/gnome-3-28-1804/145" =
# { device = "/var/lib/snapd/snaps/gnome-3-28-1804_145.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/snap-store/547" =
# { device = "/var/lib/snapd/snaps/snap-store_547.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/gnome-3-28-1804/161" =
# { device = "/var/lib/snapd/snaps/gnome-3-28-1804_161.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/gnome-3-38-2004/112" =
# { device = "/var/lib/snapd/snaps/gnome-3-38-2004_112.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/kde-frameworks-5-core18/32" =
# { device = "/var/lib/snapd/snaps/kde-frameworks-5-core18_32.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/snapd/16292" =
# { device = "/var/lib/snapd/snaps/snapd_16292.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/core18/2538" =
# { device = "/var/lib/snapd/snaps/core18_2538.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/gtk2-common-themes/13" =
# { device = "/var/lib/snapd/snaps/gtk2-common-themes_13.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/snapd/16010" =
# { device = "/var/lib/snapd/snaps/snapd_16010.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/gnome-3-34-1804/77" =
# { device = "/var/lib/snapd/snaps/gnome-3-34-1804_77.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/telegram-desktop/4116" =
# { device = "/var/lib/snapd/snaps/telegram-desktop_4116.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/zoom-client/175" =
# { device = "/var/lib/snapd/snaps/zoom-client_175.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/telegram-desktop/4095" =
# { device = "/var/lib/snapd/snaps/telegram-desktop_4095.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/gtk-common-themes/1535" =
# { device = "/var/lib/snapd/snaps/gtk-common-themes_1535.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/gimp/383" =
# { device = "/var/lib/snapd/snaps/gimp_383.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/snap-store/558" =
# { device = "/var/lib/snapd/snaps/snap-store_558.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/zoom-client/170" =
# { device = "/var/lib/snapd/snaps/zoom-client_170.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/core20/1611" =
# { device = "/var/lib/snapd/snaps/core20_1611.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/core/13308" =
# { device = "/var/lib/snapd/snaps/core_13308.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/e17fb0c0-9482-436d-83e8-3760772fe9b8";
fsType = "ext4";
};
#fileSystems."/snap/core20/1593" =
# { device = "/var/lib/snapd/snaps/core20_1593.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/core18/2409" =
# { device = "/var/lib/snapd/snaps/core18_2409.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/core/13425" =
# { device = "/var/lib/snapd/snaps/core_13425.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/gtk-common-themes/1534" =
# { device = "/var/lib/snapd/snaps/gtk-common-themes_1534.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/gnome-3-34-1804/72" =
# { device = "/var/lib/snapd/snaps/gnome-3-34-1804_72.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/gimp/393" =
# { device = "/var/lib/snapd/snaps/gimp_393.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/gnome-3-38-2004/106" =
# { device = "/var/lib/snapd/snaps/gnome-3-38-2004_106.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/snap/code/104" =
# { device = "/var/lib/snapd/snaps/code_104.snap";
# fsType = "squashfs";
# options = [ "loop" ];
# };
#fileSystems."/var/lib/docker/overlay2/cfd9350881d936ad20855c6168748edeb798891035adf93444a58a3c72a78e7d/merged" =
# { device = "overlay";
# fsType = "overlay";
# };
#fileSystems."/var/lib/docker/overlay2/57f90306c107dfd8d783015c8e5bd9ee9725148cb40f6dde57ada35063389c94/merged" =
# { device = "overlay";
# fsType = "overlay";
# };
#fileSystems."/var/lib/docker/containers/262292efecbabcd08c076a2e3b2b722df2f62ce597277fd03465ced8ce3e2173/mounts/shm" =
# { device = "shm";
# fsType = "tmpfs";
# };
#fileSystems."/var/lib/docker/containers/ecdd23824971de5eeb20946639727a4741c88f77def0d673549b929ae13ae8fd/mounts/shm" =
# { device = "shm";
# fsType = "tmpfs";
# };
swapDevices =
[ { device = "/dev/disk/by-uuid/1be15503-cd51-4c57-bb91-04f45a964202"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.br-25eea85a2a63.useDHCP = lib.mkDefault true;
# networking.interfaces.br-589021a10f40.useDHCP = lib.mkDefault true;
# networking.interfaces.br-7624ebce9469.useDHCP = lib.mkDefault true;
# networking.interfaces.br-a5ddf40cdb21.useDHCP = lib.mkDefault true;
# networking.interfaces.br-f542643d9add.useDHCP = lib.mkDefault true;
# networking.interfaces.docker0.useDHCP = lib.mkDefault true;
# networking.interfaces.docker_gwbridge.useDHCP = lib.mkDefault true;
# networking.interfaces.enp3s0.useDHCP = lib.mkDefault true;
# networking.interfaces.vetha0f735a.useDHCP = lib.mkDefault true;
# networking.interfaces.vethe5fb438.useDHCP = lib.mkDefault true;
# networking.interfaces.vethf610b0a.useDHCP = lib.mkDefault true;
# networking.interfaces.wlxd03745e1e87b.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}