moving to flake config

This commit is contained in:
Ivan Dimitrov 2023-08-07 11:19:48 +03:00
parent 34d25af4d6
commit 1f872a4253
9 changed files with 125 additions and 8 deletions

1
.gitignore vendored
View File

@ -1 +0,0 @@
hardware-configuration.nix

47
flake.lock Normal file
View File

@ -0,0 +1,47 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1691312444,
"narHash": "sha256-J9e9dGwAPTX+UlAn8jehoyaEq6fwK+L+gunfx0cYT4E=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "903e06d734bcae48efb79b9afd51b406d2744179",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1691368598,
"narHash": "sha256-ia7li22keBBbj02tEdqjVeLtc7ZlSBuhUk+7XTUFr14=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5a8e9243812ba528000995b294292d3b5e120947",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

27
flake.nix Normal file
View File

@ -0,0 +1,27 @@
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, ... }: {
nixosConfigurations = {
laptop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./sys/laptop
];
};
};
homeConfigurations = {
ivand = home-manager.lib.homeManagerConfiguration {
modules = [ ./home/laptop.nix ];
pkgs = import nixpkgs { system = "x86_64-linux"; };
};
};
};
}

View File

@ -0,0 +1,38 @@
# 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" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/sda1";
fsType = "btrfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/D76B-0BB3";
fsType = "vfat";
};
swapDevices = [ ];
# 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.enp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -109,7 +109,7 @@
}; };
zsh = { zsh = {
enable = true; enable = true;
enableSyntaxHighlighting = true; syntaxHighlighting.enable = true;
enableAutosuggestions = true; enableAutosuggestions = true;
loginExtra = '' loginExtra = ''
[ "$(tty)" = "/dev/tty1" ] && exec sway [ "$(tty)" = "/dev/tty1" ] && exec sway

View File

@ -2,11 +2,6 @@
, pkgs , pkgs
, ... , ...
}: { }: {
imports = [
./hardware-configuration.nix
<home-manager/nixos>
];
system.stateVersion = "23.05"; system.stateVersion = "23.05";
nix = { nix = {
@ -54,7 +49,7 @@
time.timeZone = "Europe/Sofia"; time.timeZone = "Europe/Sofia";
fonts.fonts = with pkgs; [ nerdfonts ]; fonts.packages = with pkgs; [ nerdfonts ];
environment = { environment = {
systemPackages = with pkgs; [ systemPackages = with pkgs; [

11
sys/laptop/default.nix Normal file
View File

@ -0,0 +1,11 @@
{ config, pkgs, ... }:
{
imports =
[
./configuration.nix
../../hardware-configuration.nix
];
}