Switching to flakes and adding home-manager
This commit is contained in:
parent
32e9c2b93c
commit
97d648948f
9 changed files with 124 additions and 26 deletions
|
|
@ -6,10 +6,9 @@
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./packages.nix
|
./packages.nix
|
||||||
./system.nix
|
./system.nix
|
||||||
./hardware.nix # Set in the up.sh script among the files in hardware/
|
# ./hardware.nix # Set in the up.sh script among the files in hardware/
|
||||||
./networking.nix
|
./networking.nix
|
||||||
./user/user.nix
|
./user/user.nix
|
||||||
<home-manager/nixos>
|
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
|
||||||
22
flake.nix
Normal file
22
flake.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
description = "NixOS Configuration";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
home-manager.url = "github:nix-community/home-manager";
|
||||||
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, nixos-hardware, ... }@attrs: {
|
||||||
|
nixosConfigurations.lyes-nix = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs = attrs;
|
||||||
|
modules = [
|
||||||
|
./configuration.nix
|
||||||
|
./hardware/x1-extreme-gen4.nix
|
||||||
|
nixos-hardware.nixosModules.lenovo-thinkpad-x1-extreme-gen4
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,10 +1,30 @@
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
# Optimisation
|
||||||
[
|
|
||||||
<nixos-hardware/lenovo/thinkpad/x1-extreme/gen4>
|
# nixpkgs.hostPlatform = {
|
||||||
];
|
# gcc.arch = "tigerlake";
|
||||||
|
# gcc.tune = "tigerlake";
|
||||||
|
# system = "x86_64-linux";
|
||||||
|
# };
|
||||||
|
|
||||||
|
nix.settings.system-features = [ "gccarch-tigerlake" "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
||||||
|
|
||||||
|
# Increasing the limit of files to help with compilation
|
||||||
|
security.pam.loginLimits = [{
|
||||||
|
domain = "*";
|
||||||
|
type = "soft";
|
||||||
|
item = "nofile";
|
||||||
|
value = "8192";
|
||||||
|
}];
|
||||||
|
|
||||||
|
# Disabling failing test
|
||||||
|
# nixpkgs.overlays = [ (final: prev: {
|
||||||
|
# orc = prev.orc.overrideAttrs (_: { doCheck = false; });
|
||||||
|
# }) ];
|
||||||
|
|
||||||
|
# NVidia
|
||||||
|
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
|
|
||||||
|
|
@ -28,4 +48,7 @@
|
||||||
# Optionally, you may need to select the appropriate driver version for your specific GPU
|
# Optionally, you may need to select the appropriate driver version for your specific GPU
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# For containers
|
||||||
|
virtualisation.containers.cdi.dynamic.nvidia.enable = true;
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -15,6 +14,7 @@
|
||||||
man-pages-posix
|
man-pages-posix
|
||||||
python3
|
python3
|
||||||
any-nix-shell
|
any-nix-shell
|
||||||
|
libcgroup
|
||||||
|
|
||||||
# Virtualization
|
# Virtualization
|
||||||
qemu
|
qemu
|
||||||
|
|
|
||||||
13
system.nix
13
system.nix
|
|
@ -38,15 +38,15 @@
|
||||||
useXkbConfig = true;
|
useXkbConfig = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.xserver.layout = "fr";
|
services.xserver.xkb.layout = "fr";
|
||||||
services.xserver.xkbVariant = "oss";
|
services.xserver.xkb.variant = "oss";
|
||||||
|
|
||||||
services.xserver.libinput.enable = true;
|
services.xserver.libinput.enable = true;
|
||||||
|
|
||||||
# Printing
|
# Printing
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
services.avahi.enable = true;
|
services.avahi.enable = true;
|
||||||
services.avahi.nssmdns = true;
|
services.avahi.nssmdns4 = true;
|
||||||
services.avahi.openFirewall = true;
|
services.avahi.openFirewall = true;
|
||||||
|
|
||||||
# Shell
|
# Shell
|
||||||
|
|
@ -56,6 +56,12 @@
|
||||||
'';
|
'';
|
||||||
environment.shells = with pkgs; [ fish ];
|
environment.shells = with pkgs; [ fish ];
|
||||||
|
|
||||||
|
# # Environment Variables
|
||||||
|
# environment.sessionVariables = {
|
||||||
|
# ELECTRON_OZONE_PLATFORM_HINT = "wayland";
|
||||||
|
# GTK_USE_PORTAL = "1";
|
||||||
|
# };
|
||||||
|
|
||||||
# Graphics
|
# Graphics
|
||||||
services.xserver.enable = true;
|
services.xserver.enable = true;
|
||||||
programs.xwayland.enable = true;
|
programs.xwayland.enable = true;
|
||||||
|
|
@ -97,6 +103,5 @@
|
||||||
dockerCompat = true;
|
dockerCompat = true;
|
||||||
defaultNetwork.settings.dns_enabled = true;
|
defaultNetwork.settings.dns_enabled = true;
|
||||||
extraPackages = [ pkgs.zfs ];
|
extraPackages = [ pkgs.zfs ];
|
||||||
enableNvidia = true;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
10
up.sh
10
up.sh
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
rm *.qcow2 result 2> /dev/null
|
rm *.qcow2 result 2> /dev/null
|
||||||
|
|
||||||
if [ -n "$1" ]; then
|
# if [ -n "$1" ]; then
|
||||||
echo "Changing hardware"
|
# echo "Changing hardware"
|
||||||
cp hardware/"$1".nix hardware.nix
|
# cp hardware/"$1".nix hardware.nix
|
||||||
exit 0
|
# exit 0
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
if [ "$EUID" -ne 0 ]; then
|
if [ "$EUID" -ne 0 ]; then
|
||||||
echo "Please run as root"
|
echo "Please run as root"
|
||||||
|
|
|
||||||
25
user/home.nix
Normal file
25
user/home.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Git config
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
userName = "Lyes Saadi";
|
||||||
|
userEmail = "dev@lyes.eu";
|
||||||
|
signing = {
|
||||||
|
key = "17418538BAA17767";
|
||||||
|
signByDefault = true;
|
||||||
|
};
|
||||||
|
extraConfig = {
|
||||||
|
code.editor = "nvim";
|
||||||
|
merge.tool = "nvim";
|
||||||
|
color.ui = true;
|
||||||
|
init.defaultBranch = "main";
|
||||||
|
includeIf = {
|
||||||
|
"gitdir:~/Documents/fedpkg/" = {
|
||||||
|
path = "~/Documents/fedpkg/.gitconfig_include";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,18 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
|
tex = (pkgs.texlive.combine { inherit (pkgs.texlive)
|
||||||
|
scheme-medium
|
||||||
|
lettre
|
||||||
|
wallpaper
|
||||||
|
lastpage
|
||||||
|
hyphenat
|
||||||
|
moresize
|
||||||
|
fontawesome5
|
||||||
|
montserrat
|
||||||
|
titlesec
|
||||||
|
ly1;
|
||||||
|
});
|
||||||
in {
|
in {
|
||||||
users.users.lyes.packages = with pkgs; [
|
users.users.lyes.packages = with pkgs; [
|
||||||
# Software
|
# Software
|
||||||
|
|
@ -13,10 +24,10 @@ in {
|
||||||
syncplay
|
syncplay
|
||||||
gnome.gnome-tweaks
|
gnome.gnome-tweaks
|
||||||
gnome-extension-manager
|
gnome-extension-manager
|
||||||
unstable.protonmail-bridge-gui
|
protonmail-bridge-gui
|
||||||
|
|
||||||
# Games
|
# Games
|
||||||
citra-canary
|
# citra-canary
|
||||||
steam
|
steam
|
||||||
minecraft
|
minecraft
|
||||||
vvvvvv
|
vvvvvv
|
||||||
|
|
@ -37,16 +48,19 @@ in {
|
||||||
|
|
||||||
# Programming
|
# Programming
|
||||||
git
|
git
|
||||||
|
vscode
|
||||||
ocaml
|
ocaml
|
||||||
ledit
|
ledit
|
||||||
nodejs
|
nodejs
|
||||||
|
nil
|
||||||
|
|
||||||
# Containers
|
# Containers
|
||||||
toolbox
|
toolbox
|
||||||
distrobox
|
distrobox
|
||||||
|
|
||||||
# Note taking
|
# Note taking
|
||||||
texlive.combined.scheme-medium
|
setzer
|
||||||
|
tex
|
||||||
pandoc
|
pandoc
|
||||||
|
|
||||||
# Multimedia
|
# Multimedia
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, home-manager, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
./packages.nix
|
./packages.nix
|
||||||
|
home-manager.nixosModules.default
|
||||||
];
|
];
|
||||||
|
|
||||||
users.users.lyes = {
|
users.users.lyes = {
|
||||||
|
|
@ -16,7 +17,16 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.users.lyes = { pkgs, ... }: {
|
home-manager.users.lyes = { pkgs, ... }: {
|
||||||
|
imports =
|
||||||
|
[
|
||||||
|
./home.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
home.username = "lyes";
|
||||||
|
home.homeDirectory = "/home/lyes";
|
||||||
|
|
||||||
home.stateVersion = "22.11";
|
home.stateVersion = "22.11";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue