From 0c92894205c8910b1fd0973c84cd06fb1b900df6 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Sat, 7 May 2022 14:21:11 -0500 Subject: [PATCH] making some basic changes to syl and user --- fish/config.fish | 5 +- flake.lock | 6 +- flake.nix | 30 +++-- scripts/update-nix | 9 +- scripts/upgrade-nix | 5 + scripts/webcam | 1 + system/syl/configuration.nix | 15 ++- user/home.nix | 221 ++++++++++++++++++++++++++++++++--- 8 files changed, 253 insertions(+), 39 deletions(-) create mode 100755 scripts/upgrade-nix diff --git a/fish/config.fish b/fish/config.fish index a90db5d..7723479 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -212,10 +212,13 @@ alias la "exa -la" alias mpf "mpv --profile=fast" alias mps "mpv --profile=slow" alias suspend "systemctl suspend" +alias sysuse "systemctl --user" +alias sys "systemctl" alias ec "emacsclient -t" alias ecc "emacsclient -c" alias mkdir "mkdir -pv" -alias upnix "update-nix" +alias nupd "update-nix" +alias nupg "upgrade-nix" ### Start X at login if status is-login diff --git a/flake.lock b/flake.lock index 801a896..54e49c3 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1651800560, - "narHash": "sha256-LUfR0/Fv8DA0uu8Uex2S1QcLiE4B5ylplbXmMs6/YoM=", + "lastModified": 1651886851, + "narHash": "sha256-kbXOJSf1uho0/7P54nZkJdJY3oAelIjyc6tfiRhaXJI=", "owner": "nix-community", "repo": "home-manager", - "rev": "538343be863cb0b9e9f1471e6dc09e0e140c7b3d", + "rev": "882bd8118bdbff3a6e53e5ced393932b351ce2f6", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 28e1008..14a7cd3 100644 --- a/flake.nix +++ b/flake.nix @@ -19,24 +19,30 @@ lib = nixpkgs.lib; in { - homeConfigurations = { - chris = home-manager.lib.homeManagerConfiguration { - inherit system pkgs username; - homeDirectory = "/home/chris"; - configuration = { - imports = [ - ./user/home.nix - ]; - }; - stateVersion = "22.05"; - }; - }; + # homeConfigurations = { + # chris = home-manager.lib.homeManagerConfiguration { + # inherit system pkgs username; + # homeDirectory = "/home/chris"; + # configuration = { + # imports = [ + # ./user/home.nix + # ]; + # }; + # stateVersion = "22.05"; + # }; + # }; nixosConfigurations = { syl = lib.nixosSystem { inherit system; modules = [ ./system/syl/configuration.nix + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.chris = import ./user/home.nix; + } ]; }; kaladin = lib.nixosSystem { diff --git a/scripts/update-nix b/scripts/update-nix index c775e7f..b907bb7 100755 --- a/scripts/update-nix +++ b/scripts/update-nix @@ -1,5 +1,6 @@ #!/bin/sh -nix-channel --update -sudo nix-channel --update -home-manager switch -sudo nixos-rebuild switch \ No newline at end of file +currentdir=$(pwd) +cd ~/.dotfiles +nix flake update +nix flake lock +cd $currentdir diff --git a/scripts/upgrade-nix b/scripts/upgrade-nix new file mode 100755 index 0000000..b691c16 --- /dev/null +++ b/scripts/upgrade-nix @@ -0,0 +1,5 @@ +#!/bin/sh +currentdir=$(pwd) +cd ~/.dotfiles +nixos-rebuild --use-remote-sudo switch --flake .# +cd $currentdir \ No newline at end of file diff --git a/scripts/webcam b/scripts/webcam index e7bca6e..5e5b173 100755 --- a/scripts/webcam +++ b/scripts/webcam @@ -1,3 +1,4 @@ #!/bin/sh +echo 'cam' mpv --profile=wc --untimed av://av4l2:/dev/video0 --title='webcam' diff --git a/system/syl/configuration.nix b/system/syl/configuration.nix index 4b36c7f..fd6e7d5 100644 --- a/system/syl/configuration.nix +++ b/system/syl/configuration.nix @@ -101,7 +101,6 @@ users.users.chris = { isNormalUser = true; extraGroups = [ "wheel" "networkmanager" "input" ]; # Enable ‘sudo’ for the user. - shell = pkgs.zsh; }; programs.partition-manager.enable = true; @@ -141,6 +140,20 @@ sddm-kcm ydotool bottles + exa mpv yt-dlp rofi-emoji + nerdfonts latte-dock bat + libsForQt5.bismuth libnotify + rofi-wayland ripgrep bc + sysstat procs papirus-icon-theme + phinger-cursors plasma-hud kde-cli-tools + macchina meson ninja cmake + extra-cmake-modules gzip + htop btop firefox kate kdialog openlp + libreoffice-fresh vlc + neochat haskellPackages.greenclip + pulsemixer any-nix-shell wtype + spotdl kdenlive ffmpeg neofetch + xdotool ]; # EMACS diff --git a/user/home.nix b/user/home.nix index 986668e..3fa42ac 100644 --- a/user/home.nix +++ b/user/home.nix @@ -18,6 +18,41 @@ # Let Home Manager install and manage itself. programs.home-manager.enable = true; + # accounts.email.accounts = { + # personal = { + # address = "chris@cochrun.xyz"; + # mbsync.enable = true; + # create = "maildir"; + # mu.enable = true; + # imap = { + # host = "mail.cochrun.xyz"; + # port = 993; + # tls.enable = true; + # }; + # smtp = { + # host = "mail.cochrun.xyz"; + # port = 25; + # tls.enable = true; + # }; + # }; + # work = { + # address = "chris@tfcconnection.org"; + # mbsync.enable = true; + # create = "maildir"; + # mu.enable = true; + # imap = { + # host = "outlook.office365.com"; + # port = 993; + # tls.enable = true; + # }; + # smtp = { + # host = "mail.cochrun.xyz"; + # port = 25; + # tls.enable = true; + # }; + # }; + # }; + programs.git = { enable = true; userName = "Chris Cochrun"; @@ -25,19 +60,6 @@ }; home.packages = with pkgs; [ - exa mpv yt-dlp rofi-emoji - nerdfonts latte-dock bat - libsForQt5.bismuth bc libnotify - rofi-wayland ripgrep - sysstat procs papirus-icon-theme - phinger-cursors plasma-hud kde-cli-tools - macchina meson ninja cmake gnumake - extra-cmake-modules gcc gzip - htop btop firefox kate kdialog openlp - easyeffects libreoffice-fresh vlc - neochat haskellPackages.greenclip - pulsemixer any-nix-shell wtype - spotdl kdenlive ffmpeg ]; programs.mu.enable = true; @@ -48,12 +70,173 @@ # defaultEditor = true; # }; - programs.mbsync.enable = true; + programs.mbsync = { + enable = true; + extraConfig = '' + IMAPAccount gmail + Host imap.gmail.com + User ccochrun21@gmail.com + Pass spveovqcgxpnaodn + AuthMechs LOGIN + SSLType IMAPS + SSLVersions SSLv3 + # CertificateFile /opt/local/share/curl/curl-ca-bundle.crt + + IMAPAccount office + Host outlook.office365.com + User chris@tfcconnection.org + Pass Gr@$$B00ts#21 + AuthMechs LOGIN + SSLType IMAPS + + IMAPAccount outlook + Host outlook.office365.com + User chris.cochrun@outlook.com + Pass GrassR00ts21 + AuthMechs LOGIN + SSLType IMAPS + + IMAPAccount cochrun + Host mail.cochrun.xyz + User chris@cochrun.xyz + Pass Gr@$$B00ts#21 + AuthMechs LOGIN + SSLType IMAPS + # SSLVersions SSLv3 + # CertificateFile /opt/local/share/curl/curl-ca-bundle.crt + # THEN WE SPECIFY THE LOCAL AND REMOTE STORAGE + # - THE REMOTE STORAGE IS WHERE WE GET THE MAIL FROM (E.G., THE + # SPECIFICATION OF AN IMAP ACCOUNT) + # - THE LOCAL STORAGE IS WHERE WE STORE THE EMAIL ON OUR COMPUTER + + # REMOTE STORAGE (USE THE IMAP ACCOUNT SPECIFIED ABOVE) + IMAPStore gmail-remote + Account gmail + + MaildirStore gmail-local + Path ~/Maildir/gmail/ + Inbox ~/Maildir/gmail/INBOX + + IMAPStore office-remote + Account office + + # LOCAL STORAGE (CREATE DIRECTORIES with mkdir -p Maildir/gmail) + + MaildirStore office-local + Path ~/Maildir/office/ + Inbox ~/Maildir/office/INBOX + Subfolders Verbatim + + + IMAPStore outlook-remote + Account outlook + + MaildirStore outlook-local + Path ~/Maildir/outlook/ + Inbox ~/Maildir/outlook/INBOX + Subfolders Verbatim + + IMAPStore cochrun-remote + Account cochrun + + MaildirStore cochrun-local + Path ~/Maildir/cochrun/ + Inbox ~/Maildir/cochrun/INBOX + Subfolders Verbatim + + # CONNECTIONS SPECIFY LINKS BETWEEN REMOTE AND LOCAL FOLDERS + # + # CONNECTIONS ARE SPECIFIED USING PATTERNS, WHICH MATCH REMOTE MAIl + # FOLDERS. SOME COMMONLY USED PATTERS INCLUDE: + # + # 1 "*" TO MATCH EVERYTHING + # 2 "!DIR" TO EXCLUDE "DIR" + # 3 "DIR" TO MATCH DIR + + Channel gmail-inbox + Far :gmail-remote: + Near :gmail-local: + Patterns "INBOX" + Create Both + Expunge Both + SyncState * + + Channel gmail-trash + Far :gmail-remote:"[Gmail]/Bin" + Near :gmail-local:"[Gmail].Bin" + Create Both + Expunge Both + SyncState * + + Channel gmail-sent + Far :gmail-remote:"[Gmail]/Sent Mail" + Near :gmail-local:"[Gmail].Sent Mail" + Create Both + Expunge Both + SyncState * + + Channel gmail-all + Far :gmail-remote:"[Gmail]/All Mail" + Near :gmail-local:"[Gmail].All Mail" + Create Both + Expunge Both + SyncState * + + Channel gmail-starred + Far :gmail-remote:"[Gmail]/Starred" + Near :gmail-local:"[Gmail].Starred" + Create Both + Expunge Both + SyncState * + + Channel office-inbox + Far :office-remote: + Near :office-local: + Patterns "*" + Create Both + Expunge Both + SyncState * + + Channel outlook-inbox + Far :outlook-remote: + Near :outlook-local: + Patterns "*" + Create Both + Expunge Both + SyncState * + + Channel cochrun-inbox + Far :cochrun-remote: + Near :cochrun-local: + Patterns "*" + Create Both + Expunge Both + SyncState * + # GROUPS PUT TOGETHER CHANNELS, SO THAT WE CAN INVOKE + # MBSYNC ON A GROUP TO SYNC ALL CHANNELS + # + # FOR INSTANCE: "mbsync gmail" GETS MAIL FROM + # "gmail-inbox", "gmail-sent", and "gmail-trash" + # + # Group gmail + # Channel gmail-inbox + # Channel gmail-sent + # Channel gmail-trash + # Channel gmail-all + # Channel gmail-starred + + Group office + Channel office-inbox + + Group outlook + Channel outlook-inbox + + Group cochrun + Channel cochrun-inbox + ''; + }; programs.msmtp.enable = true; services.mbsync.enable = true; - home.file.".mbsyncrc" = { - source = ./.mbsyncrc; - }; services.nextcloud-client = { enable = true; @@ -161,7 +344,9 @@ ec = "emacsclient -t"; ecc = "emacsclient -c"; mkdir = "mkdir -pv"; - upnix = "update-nix"; + nupd = "update-nix"; + nupg = "upgrade-nix"; + sysuse = "systemctl --user"; }; initExtra = '' macchina